diff options
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) |