Properly register reset function via the device class. CC: Gerd Hoffmann <kra...@redhat.com> Signed-off-by: Jan Kiszka <jan.kis...@siemens.com> --- 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