diff options
author | Anthony Liguori | 2011-12-05 03:39:20 +0100 |
---|---|---|
committer | Anthony Liguori | 2012-01-27 17:50:47 +0100 |
commit | b5ea932781954355a9880e2744722cd05cc496f9 (patch) | |
tree | f47482844578c1dffdae93dc3ec103a101097a71 /hw/ssd0303.c | |
parent | i2c: rename i2c_slave -> I2CSlave (diff) | |
download | qemu-b5ea932781954355a9880e2744722cd05cc496f9.tar.gz qemu-b5ea932781954355a9880e2744722cd05cc496f9.tar.xz qemu-b5ea932781954355a9880e2744722cd05cc496f9.zip |
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 <aliguori@us.ibm.com>
Diffstat (limited to 'hw/ssd0303.c')
-rw-r--r-- | hw/ssd0303.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/hw/ssd0303.c b/hw/ssd0303.c index 6a9a8a71e3..acf027fa43 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) |