qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] usb-ohci: return USBBus in usb_ohci_init_pci


From: Anthony Liguori
Subject: [Qemu-devel] [PATCH] usb-ohci: return USBBus in usb_ohci_init_pci
Date: Wed, 14 Dec 2011 18:10:17 -0600

Untested, but seemingly obvious and hard to screw up..

Signed-off-by: Anthony Liguori <address@hidden>
---
 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
 
-- 
1.7.4.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]