diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-24 13:12:29 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-27 10:50:50 -0600 |
commit | 999e12bbe85c5dcf49bef13bce4f97399c7105f4 (patch) | |
tree | 73b6ed8633a73134e9f728baa1ed2b1dab58b5b0 /hw/onenand.c | |
parent | 40021f08882aaef93c66c8c740087b6d3031b63a (diff) |
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 <aliguori@us.ibm.com>
Diffstat (limited to 'hw/onenand.c')
-rw-r--r-- | hw/onenand.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/hw/onenand.c b/hw/onenand.c index 33c9718629..e20d4d98cb 100644 --- a/hw/onenand.c +++ b/hw/onenand.c @@ -802,19 +802,28 @@ static int onenand_initfn(SysBusDevice *dev) return 0; } -static SysBusDeviceInfo onenand_info = { - .init = onenand_initfn, - .qdev.name = "onenand", - .qdev.size = sizeof(OneNANDState), - .qdev.reset = onenand_system_reset, - .qdev.props = (Property[]) { - DEFINE_PROP_UINT16("manufacturer_id", OneNANDState, id.man, 0), - DEFINE_PROP_UINT16("device_id", OneNANDState, id.dev, 0), - DEFINE_PROP_UINT16("version_id", OneNANDState, id.ver, 0), - DEFINE_PROP_INT32("shift", OneNANDState, shift, 0), - DEFINE_PROP_DRIVE("drive", OneNANDState, bdrv), - DEFINE_PROP_END_OF_LIST() - } +static Property onenand_properties[] = { + DEFINE_PROP_UINT16("manufacturer_id", OneNANDState, id.man, 0), + DEFINE_PROP_UINT16("device_id", OneNANDState, id.dev, 0), + DEFINE_PROP_UINT16("version_id", OneNANDState, id.ver, 0), + DEFINE_PROP_INT32("shift", OneNANDState, shift, 0), + DEFINE_PROP_DRIVE("drive", OneNANDState, bdrv), + DEFINE_PROP_END_OF_LIST(), +}; + +static void onenand_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = onenand_initfn; +} + +static DeviceInfo onenand_info = { + .name = "onenand", + .size = sizeof(OneNANDState), + .reset = onenand_system_reset, + .props = onenand_properties, + .class_init = onenand_class_init, }; static void onenand_register_device(void) |