summaryrefslogtreecommitdiffstats
path: root/hw/ssd0303.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-12-04 20:39:20 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-01-27 10:50:47 -0600
commitb5ea932781954355a9880e2744722cd05cc496f9 (patch)
treef47482844578c1dffdae93dc3ec103a101097a71 /hw/ssd0303.c
parent9e07bdf816b186632cda9651ac29bba76d299c03 (diff)
downloadhqemu-b5ea932781954355a9880e2744722cd05cc496f9.zip
hqemu-b5ea932781954355a9880e2744722cd05cc496f9.tar.gz
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.c23
1 files changed, 15 insertions, 8 deletions
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)
OpenPOWER on IntegriCloud