qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] usb-ohci: return USBBus in usb_ohci_init_pci
@ 2011-12-15  0:10 Anthony Liguori
  2011-12-15  8:17 ` Stefan Hajnoczi
  0 siblings, 1 reply; 5+ messages in thread
From: Anthony Liguori @ 2011-12-15  0:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori

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

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] usb-ohci: return USBBus in usb_ohci_init_pci
  2011-12-15  0:10 [Qemu-devel] [PATCH] usb-ohci: return USBBus in usb_ohci_init_pci Anthony Liguori
@ 2011-12-15  8:17 ` Stefan Hajnoczi
  2011-12-15 15:10   ` Anthony Liguori
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Hajnoczi @ 2011-12-15  8:17 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel

On Wed, Dec 14, 2011 at 06:10:17PM -0600, Anthony Liguori wrote:
> Untested, but seemingly obvious and hard to screw up..

Sounds like a challenge so let's take a look...

> -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

Missing semicolon.

Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] usb-ohci: return USBBus in usb_ohci_init_pci
  2011-12-15  8:17 ` Stefan Hajnoczi
@ 2011-12-15 15:10   ` Anthony Liguori
  2011-12-15 16:36     ` Gerd Hoffmann
  0 siblings, 1 reply; 5+ messages in thread
From: Anthony Liguori @ 2011-12-15 15:10 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel

On 12/15/2011 02:17 AM, Stefan Hajnoczi wrote:
> On Wed, Dec 14, 2011 at 06:10:17PM -0600, Anthony Liguori wrote:
>> Untested, but seemingly obvious and hard to screw up..
>
> Sounds like a challenge so let's take a look...
>
>> -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
>
> Missing semicolon.

Heh, awesome :-)  Okay, I'll actually test it next time.

Regards,

Anthony Liguori

>
> Stefan
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] usb-ohci: return USBBus in usb_ohci_init_pci
  2011-12-15 15:10   ` Anthony Liguori
@ 2011-12-15 16:36     ` Gerd Hoffmann
  2011-12-15 16:49       ` Anthony Liguori
  0 siblings, 1 reply; 5+ messages in thread
From: Gerd Hoffmann @ 2011-12-15 16:36 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Stefan Hajnoczi, qemu-devel

  Hi,

> Heh, awesome :-)  Okay, I'll actually test it next time.

Could you also add some justification for the change to the commit
message please?  Just for itself the change looks somewhat odd as there
is no obvious reason for it ...

thanks,
  Gerd

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] usb-ohci: return USBBus in usb_ohci_init_pci
  2011-12-15 16:36     ` Gerd Hoffmann
@ 2011-12-15 16:49       ` Anthony Liguori
  0 siblings, 0 replies; 5+ messages in thread
From: Anthony Liguori @ 2011-12-15 16:49 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Stefan Hajnoczi, Anthony Liguori, qemu-devel

On 12/15/2011 10:36 AM, Gerd Hoffmann wrote:
>    Hi,
>
>> Heh, awesome :-)  Okay, I'll actually test it next time.
>
> Could you also add some justification for the change to the commit
> message please?  Just for itself the change looks somewhat odd as there
> is no obvious reason for it ...

Yup.

Regards,

Anthony Liguori

>
> thanks,
>    Gerd
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-12-15 16:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-15  0:10 [Qemu-devel] [PATCH] usb-ohci: return USBBus in usb_ohci_init_pci Anthony Liguori
2011-12-15  8:17 ` Stefan Hajnoczi
2011-12-15 15:10   ` Anthony Liguori
2011-12-15 16:36     ` Gerd Hoffmann
2011-12-15 16:49       ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).