[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 12/37] xhci: Clean up reset function
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 12/37] xhci: Clean up reset function |
Date: |
Thu, 7 Jun 2012 11:31:01 +0200 |
From: Jan Kiszka <address@hidden>
Properly register reset function via the device class.
Signed-off-by: Jan Kiszka <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/hcd-xhci.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 5cf1a64..4bc1e0e 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -2296,9 +2296,9 @@ static void xhci_update_port(XHCIState *xhci, XHCIPort
*port, int is_detach)
}
}
-static void xhci_reset(void *opaque)
+static void xhci_reset(DeviceState *dev)
{
- XHCIState *xhci = opaque;
+ XHCIState *xhci = DO_UPCAST(XHCIState, pci_dev.qdev, dev);
int i;
DPRINTF("xhci: full reset\n");
@@ -2506,7 +2506,7 @@ static void xhci_oper_write(XHCIState *xhci, uint32_t
reg, uint32_t val)
}
xhci->usbcmd = val & 0xc0f;
if (val & USBCMD_HCRST) {
- xhci_reset(xhci);
+ xhci_reset(&xhci->pci_dev.qdev);
}
xhci_irq_update(xhci);
break;
@@ -2831,8 +2831,6 @@ static void usb_xhci_init(XHCIState *xhci, DeviceState
*dev)
for (i = 0; i < MAXSLOTS; i++) {
xhci->slots[i].enabled = 0;
}
-
- qemu_register_reset(xhci_reset, xhci);
}
static int usb_xhci_initfn(struct PCIDevice *dev)
@@ -2895,6 +2893,7 @@ static void xhci_class_init(ObjectClass *klass, void
*data)
dc->vmsd = &vmstate_xhci;
dc->props = xhci_properties;
+ dc->reset = xhci_reset;
k->init = usb_xhci_initfn;
k->vendor_id = PCI_VENDOR_ID_NEC;
k->device_id = PCI_DEVICE_ID_NEC_UPD720200;
--
1.7.1
- [Qemu-devel] [PATCH 04/37] uhci: fix trace format strings, (continued)
- [Qemu-devel] [PATCH 04/37] uhci: fix trace format strings, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 09/37] usb-storage: add usb_msd_packet_complete(), Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 32/37] ehci: update status bits in ehci_set_state, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 27/37] ehci: move async schedule to bottom half, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 01/37] uhci: fix bandwidth management, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 22/37] ehci: cache USBDevice in EHCIQueue, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 10/37] usb-storage: add scsi_off, remove scsi_buf, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 06/37] uhci: fix irq routing, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 18/37] xhci: trace: transfers, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 26/37] ehci: add async field to EHCIQueue, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 12/37] xhci: Clean up reset function,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 21/37] ehci: make ehci_execute work on EHCIPacket instead of EHCIQueue, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 11/37] usb-storage: migration support, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 07/37] scsi: prepare migration code for usb-storage support, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 16/37] xhci: trace: ring fetch, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 36/37] ehci: adaptive wakeup rate., Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 31/37] ehci: add ehci_*_enabled() helpers, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 34/37] ehci: remove unused attach_poll_counter, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 15/37] xhci: trace: irq + events, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 37/37] ehci: rework frame skipping, Gerd Hoffmann, 2012/06/07
- [Qemu-devel] [PATCH 33/37] ehci: fix halt status handling, Gerd Hoffmann, 2012/06/07