diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-04 20:39:20 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-27 10:50:47 -0600 |
commit | b5ea932781954355a9880e2744722cd05cc496f9 (patch) | |
tree | f47482844578c1dffdae93dc3ec103a101097a71 /hw/twl92230.c | |
parent | 9e07bdf816b186632cda9651ac29bba76d299c03 (diff) | |
download | qemu-b5ea932781954355a9880e2744722cd05cc496f9.zip |
i2c: smbus: convert to QEMU Object Model
This converts two types because smbus is implemented as a subclass of i2c. It's
extremely difficult to convert these two independently.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/twl92230.c')
-rw-r--r-- | hw/twl92230.c | 23 |
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) |