aboutsummaryrefslogtreecommitdiff
path: root/hw/misc/tmp105.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/misc/tmp105.c')
-rw-r--r--hw/misc/tmp105.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/hw/misc/tmp105.c b/hw/misc/tmp105.c
index 9e22d64..0918f3a 100644
--- a/hw/misc/tmp105.c
+++ b/hw/misc/tmp105.c
@@ -229,15 +229,14 @@ static void tmp105_reset(I2CSlave *i2c)
tmp105_interrupt_update(s);
}
-static int tmp105_init(I2CSlave *i2c)
+static void tmp105_realize(DeviceState *dev, Error **errp)
{
+ I2CSlave *i2c = I2C_SLAVE(dev);
TMP105State *s = TMP105(i2c);
qdev_init_gpio_out(&i2c->qdev, &s->pin, 1);
tmp105_reset(&s->i2c);
-
- return 0;
}
static void tmp105_initfn(Object *obj)
@@ -252,7 +251,7 @@ static void tmp105_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
I2CSlaveClass *k = I2C_SLAVE_CLASS(klass);
- k->init = tmp105_init;
+ dc->realize = tmp105_realize;
k->event = tmp105_event;
k->recv = tmp105_rx;
k->send = tmp105_tx;