Patchwork [11/14] ohci: get ohci state via container_of()

login
register
mail settings
Submitter Gerd Hoffmann
Date May 4, 2011, 3:41 p.m.
Message ID <1304523708-9556-12-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/94066/
State New
Headers show

Comments

Gerd Hoffmann - May 4, 2011, 3:41 p.m.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb-ohci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c
index 0ad4f55..7678cdb 100644
--- a/hw/usb-ohci.c
+++ b/hw/usb-ohci.c
@@ -577,7 +577,7 @@  static void ohci_process_lists(OHCIState *ohci, int completion);
 
 static void ohci_async_complete_packet(USBPacket *packet, void *opaque)
 {
-    OHCIState *ohci = opaque;
+    OHCIState *ohci = container_of(packet, OHCIState, usb_packet);
 #ifdef DEBUG_PACKET
     DPRINTF("Async packet complete\n");
 #endif