summaryrefslogtreecommitdiff
path: root/hw/twl92230.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/twl92230.c')
-rw-r--r--hw/twl92230.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/hw/twl92230.c b/hw/twl92230.c
index ced705c2b9..ba4f8aae75 100644
--- a/hw/twl92230.c
+++ b/hw/twl92230.c
@@ -857,14 +857,21 @@ static int twl92230_init(I2CSlave *i2c)
return 0;
}
-static I2CSlaveInfo twl92230_info = {
- .qdev.name ="twl92230",
- .qdev.size = sizeof(MenelausState),
- .qdev.vmsd = &vmstate_menelaus,
- .init = twl92230_init,
- .event = menelaus_event,
- .recv = menelaus_rx,
- .send = menelaus_tx
+static void twl92230_class_init(ObjectClass *klass, void *data)
+{
+ I2CSlaveClass *sc = I2C_SLAVE_CLASS(klass);
+
+ sc->init = twl92230_init;
+ sc->event = menelaus_event;
+ sc->recv = menelaus_rx;
+ sc->send = menelaus_tx;
+}
+
+static DeviceInfo twl92230_info = {
+ .name ="twl92230",
+ .size = sizeof(MenelausState),
+ .vmsd = &vmstate_menelaus,
+ .class_init = twl92230_class_init,
};
static void twl92230_register_devices(void)