[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 26/26] ehci: use realize for ehci
From: |
Hu Tao |
Subject: |
[Qemu-devel] [PATCH 26/26] ehci: use realize for ehci |
Date: |
Sat, 22 Jun 2013 16:50:38 +0800 |
Cc: Gerd Hoffmann <address@hidden>
Signed-off-by: Hu Tao <address@hidden>
---
hw/usb/hcd-ehci-sysbus.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/hw/usb/hcd-ehci-sysbus.c b/hw/usb/hcd-ehci-sysbus.c
index b68a66a..8cb594d 100644
--- a/hw/usb/hcd-ehci-sysbus.c
+++ b/hw/usb/hcd-ehci-sysbus.c
@@ -32,9 +32,10 @@ static Property ehci_sysbus_properties[] = {
DEFINE_PROP_END_OF_LIST(),
};
-static int usb_ehci_sysbus_initfn(SysBusDevice *dev)
+static void usb_ehci_sysbus_realize(DeviceState *dev, Error **errp)
{
EHCISysBusState *i = SYS_BUS_EHCI(dev);
+ SysBusDevice *bus = SYS_BUS_DEVICE(dev);
SysBusEHCIClass *sec = SYS_BUS_EHCI_GET_CLASS(dev);
EHCIState *s = &i->ehci;
@@ -43,17 +44,15 @@ static int usb_ehci_sysbus_initfn(SysBusDevice *dev)
s->dma = &dma_context_memory;
usb_ehci_initfn(s, DEVICE(dev));
- sysbus_init_irq(dev, &s->irq);
- sysbus_init_mmio(dev, &s->mem);
- return 0;
+ sysbus_init_irq(bus, &s->irq);
+ sysbus_init_mmio(bus, &s->mem);
}
static void ehci_sysbus_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
- SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
- k->init = usb_ehci_sysbus_initfn;
+ dc->realize = usb_ehci_sysbus_realize;
dc->vmsd = &vmstate_ehci_sysbus;
dc->props = ehci_sysbus_properties;
}
--
1.8.3.1
- Re: [Qemu-devel] [PATCH 21/26] kvmclock: use realize for kvmclock, (continued)
[Qemu-devel] [PATCH 19/26] hpet: use realize for hpet, Hu Tao, 2013/06/22
[Qemu-devel] [PATCH 18/26] scsi esp: QOM'ify some more, Hu Tao, 2013/06/22
[Qemu-devel] [PATCH 22/26] kvmclock: QOM'ify some more, Hu Tao, 2013/06/22
[Qemu-devel] [PATCH 25/26] isa bus: use realize for isa bus, Hu Tao, 2013/06/22
[Qemu-devel] [PATCH 23/26] kvmvapic realize, Hu Tao, 2013/06/22
[Qemu-devel] [PATCH 26/26] ehci: use realize for ehci,
Hu Tao <=
[Qemu-devel] [PATCH 20/26] hpet: QOM'ify some more, Hu Tao, 2013/06/22
[Qemu-devel] [PATCH 24/26] ioapic: use realize for ioapic, Hu Tao, 2013/06/22
Re: [Qemu-devel] [PATCH 00/26] use realizefn for SysBusDevice, part 1, Andreas Färber, 2013/06/30