aboutsummaryrefslogtreecommitdiff
path: root/hw/misc/tmp105.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2018-05-28 16:45:07 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2018-06-01 15:14:31 +0200
commitc8c9e1039434b907ee982f3be04f81576bd1f588 (patch)
tree3cdbf978b8234f0676c6cbeea0ea110b3fbd1f3c /hw/misc/tmp105.c
parent19473e51cc1b019b1987261e1af8bc8b4a858f12 (diff)
downloadqemu-c8c9e1039434b907ee982f3be04f81576bd1f588.zip
qemu-c8c9e1039434b907ee982f3be04f81576bd1f588.tar.gz
qemu-c8c9e1039434b907ee982f3be04f81576bd1f588.tar.bz2
hw/i2c: Use DeviceClass::realize instead of I2CSlaveClass::init
I2CSlaveClass::init is no more used, remove it. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20180419212727.26095-3-f4bug@amsat.org> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20180528144509.15812-3-armbru@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
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;