From b5ea932781954355a9880e2744722cd05cc496f9 Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Sun, 4 Dec 2011 20:39:20 -0600 Subject: i2c: smbus: convert to QEMU Object Model This converts two types because smbus is implemented as a subclass of i2c. It's extremely difficult to convert these two independently. Signed-off-by: Anthony Liguori --- hw/ssd0303.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'hw/ssd0303.c') diff --git a/hw/ssd0303.c b/hw/ssd0303.c index 6a9a8a7..acf027f 100644 --- a/hw/ssd0303.c +++ b/hw/ssd0303.c @@ -294,14 +294,21 @@ static int ssd0303_init(I2CSlave *i2c) return 0; } -static I2CSlaveInfo ssd0303_info = { - .qdev.name = "ssd0303", - .qdev.size = sizeof(ssd0303_state), - .qdev.vmsd = &vmstate_ssd0303, - .init = ssd0303_init, - .event = ssd0303_event, - .recv = ssd0303_recv, - .send = ssd0303_send +static void ssd0303_class_init(ObjectClass *klass, void *data) +{ + I2CSlaveClass *k = I2C_SLAVE_CLASS(klass); + + k->init = ssd0303_init; + k->event = ssd0303_event; + k->recv = ssd0303_recv; + k->send = ssd0303_send; +} + +static DeviceInfo ssd0303_info = { + .name = "ssd0303", + .size = sizeof(ssd0303_state), + .vmsd = &vmstate_ssd0303, + .class_init = ssd0303_class_init, }; static void ssd0303_register_devices(void) -- cgit v1.1