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/nand.c | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'hw/nand.c') diff --git a/hw/nand.c b/hw/nand.c index 8597aa6b1c..62487311ff 100644 --- a/hw/nand.c +++ b/hw/nand.c @@ -417,18 +417,27 @@ static int nand_device_init(SysBusDevice *dev) return 0; } -static SysBusDeviceInfo nand_info = { - .init = nand_device_init, - .qdev.name = "nand", - .qdev.size = sizeof(NANDFlashState), - .qdev.reset = nand_reset, - .qdev.vmsd = &vmstate_nand, - .qdev.props = (Property[]) { - DEFINE_PROP_UINT8("manufacturer_id", NANDFlashState, manf_id, 0), - DEFINE_PROP_UINT8("chip_id", NANDFlashState, chip_id, 0), - DEFINE_PROP_DRIVE("drive", NANDFlashState, bdrv), - DEFINE_PROP_END_OF_LIST() - } +static Property nand_properties[] = { + DEFINE_PROP_UINT8("manufacturer_id", NANDFlashState, manf_id, 0), + DEFINE_PROP_UINT8("chip_id", NANDFlashState, chip_id, 0), + DEFINE_PROP_DRIVE("drive", NANDFlashState, bdrv), + DEFINE_PROP_END_OF_LIST(), +}; + +static void nand_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = nand_device_init; +} + +static DeviceInfo nand_info = { + .name = "nand", + .size = sizeof(NANDFlashState), + .reset = nand_reset, + .vmsd = &vmstate_nand, + .props = nand_properties, + .class_init = nand_class_init, }; static void nand_create_device(void) -- cgit v1.2.3-55-g7522