diff options
Diffstat (limited to 'hw/cs4231a.c')
-rw-r--r-- | hw/cs4231a.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/hw/cs4231a.c b/hw/cs4231a.c index 811c76bbb3..811dda6516 100644 --- a/hw/cs4231a.c +++ b/hw/cs4231a.c @@ -665,28 +665,32 @@ int cs4231a_init (ISABus *bus) return 0; } +static Property cs4231a_properties[] = { + DEFINE_PROP_HEX32 ("iobase", CSState, port, 0x534), + DEFINE_PROP_UINT32 ("irq", CSState, irq, 9), + DEFINE_PROP_UINT32 ("dma", CSState, dma, 3), + DEFINE_PROP_END_OF_LIST (), +}; + static void cs4231a_class_initfn(ObjectClass *klass, void *data) { + DeviceClass *dc = DEVICE_CLASS(klass); ISADeviceClass *ic = ISA_DEVICE_CLASS(klass); ic->init = cs4231a_initfn; + dc->desc = "Crystal Semiconductor CS4231A"; + dc->vmsd = &vmstate_cs4231a; + dc->props = cs4231a_properties; } -static DeviceInfo cs4231a_info = { - .name = "cs4231a", - .desc = "Crystal Semiconductor CS4231A", - .size = sizeof (CSState), - .vmsd = &vmstate_cs4231a, - .class_init = cs4231a_class_initfn, - .props = (Property[]) { - DEFINE_PROP_HEX32 ("iobase", CSState, port, 0x534), - DEFINE_PROP_UINT32 ("irq", CSState, irq, 9), - DEFINE_PROP_UINT32 ("dma", CSState, dma, 3), - DEFINE_PROP_END_OF_LIST (), - }, +static TypeInfo cs4231a_info = { + .name = "cs4231a", + .parent = TYPE_ISA_DEVICE, + .instance_size = sizeof (CSState), + .class_init = cs4231a_class_initfn, }; static void cs4231a_register (void) { - isa_qdev_register (&cs4231a_info); + type_register_static(&cs4231a_info); } device_init (cs4231a_register) |