aboutsummaryrefslogtreecommitdiff
path: root/hw/tmp105.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/tmp105.c
parent9e07bdf816b186632cda9651ac29bba76d299c03 (diff)
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/tmp105.c')
-rw-r--r--hw/tmp105.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/hw/tmp105.c b/hw/tmp105.c
index ed8a0f3fc8..12fe60d019 100644
--- a/hw/tmp105.c
+++ b/hw/tmp105.c
@@ -226,14 +226,21 @@ static int tmp105_init(I2CSlave *i2c)
return 0;
}
-static I2CSlaveInfo tmp105_info = {
- .qdev.name = "tmp105",
- .qdev.size = sizeof(TMP105State),
- .qdev.vmsd = &vmstate_tmp105,
- .init = tmp105_init,
- .event = tmp105_event,
- .recv = tmp105_rx,
- .send = tmp105_tx
+static void tmp105_class_init(ObjectClass *klass, void *data)
+{
+ I2CSlaveClass *k = I2C_SLAVE_CLASS(klass);
+
+ k->init = tmp105_init;
+ k->event = tmp105_event;
+ k->recv = tmp105_rx;
+ k->send = tmp105_tx;
+}
+
+static DeviceInfo tmp105_info = {
+ .name = "tmp105",
+ .size = sizeof(TMP105State),
+ .vmsd = &vmstate_tmp105,
+ .class_init = tmp105_class_init,
};
static void tmp105_register_devices(void)