From patchwork Thu Dec 15 00:10:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 131507 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 364711007D6 for ; Thu, 15 Dec 2011 11:10:43 +1100 (EST) Received: from localhost ([::1]:34835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RayuF-00081z-Qa for incoming@patchwork.ozlabs.org; Wed, 14 Dec 2011 19:10:39 -0500 Received: from eggs.gnu.org ([140.186.70.92]:54470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rayu9-000815-Ir for qemu-devel@nongnu.org; Wed, 14 Dec 2011 19:10:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rayu8-0004cd-Cq for qemu-devel@nongnu.org; Wed, 14 Dec 2011 19:10:33 -0500 Received: from cpe-70-123-132-139.austin.res.rr.com ([70.123.132.139]:52407 helo=localhost6.localdomain6) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rayu8-0004cQ-2E for qemu-devel@nongnu.org; Wed, 14 Dec 2011 19:10:32 -0500 Received: from localhost6.localdomain6 (localhost.localdomain [127.0.0.1]) by localhost6.localdomain6 (8.14.4/8.14.4/Debian-2ubuntu1) with ESMTP id pBF0AMLW027381; Wed, 14 Dec 2011 18:10:23 -0600 Received: (from anthony@localhost) by localhost6.localdomain6 (8.14.4/8.14.4/Submit) id pBF0ALL6027379; Wed, 14 Dec 2011 18:10:21 -0600 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Wed, 14 Dec 2011 18:10:17 -0600 Message-Id: <1323907817-27342-1-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.7.4.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 70.123.132.139 Cc: Anthony Liguori Subject: [Qemu-devel] [PATCH] usb-ohci: return USBBus in usb_ohci_init_pci X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Untested, but seemingly obvious and hard to screw up.. Signed-off-by: Anthony Liguori --- hw/usb-ohci.c | 7 +++++-- hw/usb-ohci.h | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c index e68be70..4c56548 100644 --- a/hw/usb-ohci.c +++ b/hw/usb-ohci.c @@ -1810,9 +1810,12 @@ static int usb_ohci_initfn_pci(struct PCIDevice *dev) return 0; } -void usb_ohci_init_pci(struct PCIBus *bus, int devfn) +USBBus *usb_ohci_init_pci(struct PCIBus *bus, int devfn) { - pci_create_simple(bus, devfn, "pci-ohci"); + PCIDevice *dev = pci_create_simple(bus, devfn, "pci-ohci"); + OHCIPCIState *ohci = DO_UPCAST(OHCIPCIState, pci_dev, dev); + + return &ohci->state.bus } typedef struct { diff --git a/hw/usb-ohci.h b/hw/usb-ohci.h index eefcef3..2a63ca9 100644 --- a/hw/usb-ohci.h +++ b/hw/usb-ohci.h @@ -2,8 +2,9 @@ #define QEMU_USB_OHCI_H #include "qemu-common.h" +#include "usb.h" -void usb_ohci_init_pci(struct PCIBus *bus, int devfn); +USBBus *usb_ohci_init_pci(struct PCIBus *bus, int devfn); #endif