[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 05/10] xhci: Clean up reset function
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH v2 05/10] xhci: Clean up reset function |
Date: |
Thu, 10 May 2012 17:08:21 -0300 |
Properly register reset function via the device class.
CC: Gerd Hoffmann <address@hidden>
Signed-off-by: Jan Kiszka <address@hidden>
---
hw/usb/hcd-xhci.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index c4079eb..814117c 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -2339,9 +2339,9 @@ static void xhci_reset_full(XHCIState *xhci)
xhci->ev_buffer_get = 0;
}
-static void xhci_reset(void *opaque)
+static void xhci_reset(DeviceState *dev)
{
- XHCIState *xhci = opaque;
+ XHCIState *xhci = DO_UPCAST(XHCIState, pci_dev.qdev, dev);
msi_reset(&xhci->pci_dev);
xhci_reset_full(xhci);
@@ -2838,8 +2838,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)
@@ -2902,6 +2900,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.3.4
- [Qemu-devel] [PATCH v2 00/10] msi: Refactorings and reset fixes, Jan Kiszka, 2012/05/10
- [Qemu-devel] [PATCH v2 06/10] msi: Guard msi_reset with msi_present, Jan Kiszka, 2012/05/10
- [Qemu-devel] [PATCH v2 08/10] msi: Guard msi/msix_write_config with msi_present, Jan Kiszka, 2012/05/10
- [Qemu-devel] [PATCH v2 07/10] msi: Invoke msi/msix_reset from PCI core, Jan Kiszka, 2012/05/10
- [Qemu-devel] [PATCH v2 09/10] msi: Invoke msi/msix_write_config from PCI core, Jan Kiszka, 2012/05/10
- [Qemu-devel] [PATCH v2 10/10] msi: Use msi/msix_present more consistently, Jan Kiszka, 2012/05/10