From 999e12bbe85c5dcf49bef13bce4f97399c7105f4 Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Tue, 24 Jan 2012 13:12:29 -0600 Subject: sysbus: apic: ioapic: convert to QEMU Object Model This converts three devices because apic and ioapic are subclasses of sysbus. Converting subclasses independently of their base class is prohibitively hard. Signed-off-by: Anthony Liguori --- hw/pxa2xx_dma.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'hw/pxa2xx_dma.c') diff --git a/hw/pxa2xx_dma.c b/hw/pxa2xx_dma.c index cb28107..9ecec33 100644 --- a/hw/pxa2xx_dma.c +++ b/hw/pxa2xx_dma.c @@ -543,16 +543,25 @@ static VMStateDescription vmstate_pxa2xx_dma = { }, }; -static SysBusDeviceInfo pxa2xx_dma_info = { - .init = pxa2xx_dma_init, - .qdev.name = "pxa2xx-dma", - .qdev.desc = "PXA2xx DMA controller", - .qdev.size = sizeof(PXA2xxDMAState), - .qdev.vmsd = &vmstate_pxa2xx_dma, - .qdev.props = (Property[]) { - DEFINE_PROP_INT32("channels", PXA2xxDMAState, channels, -1), - DEFINE_PROP_END_OF_LIST(), - }, +static Property pxa2xx_dma_properties[] = { + DEFINE_PROP_INT32("channels", PXA2xxDMAState, channels, -1), + DEFINE_PROP_END_OF_LIST(), +}; + +static void pxa2xx_dma_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = pxa2xx_dma_init; +} + +static DeviceInfo pxa2xx_dma_info = { + .name = "pxa2xx-dma", + .desc = "PXA2xx DMA controller", + .size = sizeof(PXA2xxDMAState), + .vmsd = &vmstate_pxa2xx_dma, + .props = pxa2xx_dma_properties, + .class_init = pxa2xx_dma_class_init, }; static void pxa2xx_dma_register(void) -- cgit v1.1