qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH][RFC 14/14] uhci: refactor uhci's power callbacks


From: liguang
Subject: [Qemu-devel] [PATCH][RFC 14/14] uhci: refactor uhci's power callbacks
Date: Wed, 13 Mar 2013 16:01:21 +0800

Signed-off-by: liguang <address@hidden>
---
 hw/usb/hcd-uhci.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index f8c4286..008f567 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -414,6 +414,14 @@ static void uhci_reset(void *opaque)
     uhci_update_irq(s);
 }
 
+static void uhci_dev_reset(DeviceState *dev)
+{
+    PCIDevice *pdev = PCI_DEVICE(dev);
+    UHCIState *s = container_of(pdev, UHCIState, dev);
+
+    uhci_reset(s);
+}
+
 static const VMStateDescription vmstate_uhci_port = {
     .name = "uhci port",
     .version_id = 1,
@@ -1307,6 +1315,8 @@ static void uhci_class_init(ObjectClass *klass, void 
*data)
     k->class_id  = PCI_CLASS_SERIAL_USB;
     k->no_hotplug = 1;
     dc->vmsd = &vmstate_uhci;
+    dc->reset = uhci_dev_reset;
+    dc->on = uhci_dev_reset;
     dc->props = uhci_properties;
     u->info = *info;
 }
-- 
1.7.2.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]