From 8f04ee0882aec9fe91fb70f767edf5dacff59835 Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Sun, 4 Dec 2011 11:52:49 -0600 Subject: isa: pic: convert to QEMU Object Model This converts two devices at once because PIC subclasses ISA and converting subclasses independently is extremely hard. Signed-off-by: Anthony Liguori --- hw/cs4231a.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'hw/cs4231a.c') diff --git a/hw/cs4231a.c b/hw/cs4231a.c index dc77a3aa15..811c76bbb3 100644 --- a/hw/cs4231a.c +++ b/hw/cs4231a.c @@ -665,13 +665,19 @@ int cs4231a_init (ISABus *bus) return 0; } -static ISADeviceInfo cs4231a_info = { - .qdev.name = "cs4231a", - .qdev.desc = "Crystal Semiconductor CS4231A", - .qdev.size = sizeof (CSState), - .qdev.vmsd = &vmstate_cs4231a, - .init = cs4231a_initfn, - .qdev.props = (Property[]) { +static void cs4231a_class_initfn(ObjectClass *klass, void *data) +{ + ISADeviceClass *ic = ISA_DEVICE_CLASS(klass); + ic->init = cs4231a_initfn; +} + +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), -- cgit v1.2.3