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/tosa.c | |
parent | 9e07bdf816b186632cda9651ac29bba76d299c03 (diff) | |
download | qemu-b5ea932781954355a9880e2744722cd05cc496f9.zip qemu-b5ea932781954355a9880e2744722cd05cc496f9.tar.gz qemu-b5ea932781954355a9880e2744722cd05cc496f9.tar.bz2 |
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/tosa.c')
-rw-r--r-- | hw/tosa.c | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -259,13 +259,20 @@ static void tosapda_machine_init(void) machine_init(tosapda_machine_init); -static I2CSlaveInfo tosa_dac_info = { - .qdev.name = "tosa_dac", - .qdev.size = sizeof(TosaDACState), - .init = tosa_dac_init, - .event = tosa_dac_event, - .recv = tosa_dac_recv, - .send = tosa_dac_send +static void tosa_dac_class_init(ObjectClass *klass, void *data) +{ + I2CSlaveClass *k = I2C_SLAVE_CLASS(klass); + + k->init = tosa_dac_init; + k->event = tosa_dac_event; + k->recv = tosa_dac_recv; + k->send = tosa_dac_send; +} + +static DeviceInfo tosa_dac_info = { + .name = "tosa_dac", + .size = sizeof(TosaDACState), + .class_init = tosa_dac_class_init, }; static void tosa_ssp_class_init(ObjectClass *klass, void *data) |