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/ds1338.c | |
parent | 9e07bdf816b186632cda9651ac29bba76d299c03 (diff) |
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/ds1338.c')
-rw-r--r-- | hw/ds1338.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/hw/ds1338.c b/hw/ds1338.c index 1c4ba9fcd0..4e09efe123 100644 --- a/hw/ds1338.c +++ b/hw/ds1338.c @@ -118,13 +118,20 @@ static int ds1338_init(I2CSlave *i2c) return 0; } -static I2CSlaveInfo ds1338_info = { - .qdev.name = "ds1338", - .qdev.size = sizeof(DS1338State), - .init = ds1338_init, - .event = ds1338_event, - .recv = ds1338_recv, - .send = ds1338_send, +static void ds1338_class_init(ObjectClass *klass, void *data) +{ + I2CSlaveClass *k = I2C_SLAVE_CLASS(klass); + + k->init = ds1338_init; + k->event = ds1338_event; + k->recv = ds1338_recv; + k->send = ds1338_send; +} + +static DeviceInfo ds1338_info = { + .name = "ds1338", + .size = sizeof(DS1338State), + .class_init = ds1338_class_init, }; static void ds1338_register_devices(void) |