aboutsummaryrefslogtreecommitdiff
path: root/hw/timer/twl92230.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/timer/twl92230.c
parent19473e51cc1b019b1987261e1af8bc8b4a858f12 (diff)
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/timer/twl92230.c')
-rw-r--r--hw/timer/twl92230.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/hw/timer/twl92230.c b/hw/timer/twl92230.c
index ef116c636c..3b43b46199 100644
--- a/hw/timer/twl92230.c
+++ b/hw/timer/twl92230.c
@@ -853,10 +853,9 @@ static const VMStateDescription vmstate_menelaus = {
}
};
-static int twl92230_init(I2CSlave *i2c)
+static void twl92230_realize(DeviceState *dev, Error **errp)
{
- DeviceState *dev = DEVICE(i2c);
- MenelausState *s = TWL92230(i2c);
+ MenelausState *s = TWL92230(dev);
s->rtc.hz_tm = timer_new_ms(rtc_clock, menelaus_rtc_hz, s);
/* Three output pins plus one interrupt pin. */
@@ -865,9 +864,7 @@ static int twl92230_init(I2CSlave *i2c)
/* Three input pins plus one power-button pin. */
qdev_init_gpio_in(dev, menelaus_gpio_set, 4);
- menelaus_reset(i2c);
-
- return 0;
+ menelaus_reset(I2C_SLAVE(dev));
}
static void twl92230_class_init(ObjectClass *klass, void *data)
@@ -875,7 +872,7 @@ static void twl92230_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
I2CSlaveClass *sc = I2C_SLAVE_CLASS(klass);
- sc->init = twl92230_init;
+ dc->realize = twl92230_realize;
sc->event = menelaus_event;
sc->recv = menelaus_rx;
sc->send = menelaus_tx;