aboutsummaryrefslogtreecommitdiff
path: root/hw/tmp105.c
diff options
context:
space:
mode:
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)