summary refs log tree commit diff stats
path: root/hw/ds1338.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/ds1338.c
parent9e07bdf816b186632cda9651ac29bba76d299c03 (diff)
downloadfocaccia-qemu-b5ea932781954355a9880e2744722cd05cc496f9.tar.gz
focaccia-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/ds1338.c')
-rw-r--r--hw/ds1338.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/hw/ds1338.c b/hw/ds1338.c
index 1c4ba9fcd0..4e09efe123 100644
--- a/hw/ds1338.c
+++ b/hw/ds1338.c
@@ -118,13 +118,20 @@ static int ds1338_init(I2CSlave *i2c)
     return 0;
 }
 
-static I2CSlaveInfo ds1338_info = {
-    .qdev.name = "ds1338",
-    .qdev.size = sizeof(DS1338State),
-    .init = ds1338_init,
-    .event = ds1338_event,
-    .recv = ds1338_recv,
-    .send = ds1338_send,
+static void ds1338_class_init(ObjectClass *klass, void *data)
+{
+    I2CSlaveClass *k = I2C_SLAVE_CLASS(klass);
+
+    k->init = ds1338_init;
+    k->event = ds1338_event;
+    k->recv = ds1338_recv;
+    k->send = ds1338_send;
+}
+
+static DeviceInfo ds1338_info = {
+    .name = "ds1338",
+    .size = sizeof(DS1338State),
+    .class_init = ds1338_class_init,
 };
 
 static void ds1338_register_devices(void)