diff options
Diffstat (limited to 'hw/bitbang_i2c.c')
-rw-r--r-- | hw/bitbang_i2c.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/hw/bitbang_i2c.c b/hw/bitbang_i2c.c index 93fb2ed2c8..da9e5cf3d3 100644 --- a/hw/bitbang_i2c.c +++ b/hw/bitbang_i2c.c @@ -221,11 +221,18 @@ static int gpio_i2c_init(SysBusDevice *dev) return 0; } -static SysBusDeviceInfo gpio_i2c_info = { - .init = gpio_i2c_init, - .qdev.name = "gpio_i2c", - .qdev.desc = "Virtual GPIO to I2C bridge", - .qdev.size = sizeof(GPIOI2CState), +static void gpio_i2c_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = gpio_i2c_init; +} + +static DeviceInfo gpio_i2c_info = { + .name = "gpio_i2c", + .desc = "Virtual GPIO to I2C bridge", + .size = sizeof(GPIOI2CState), + .class_init = gpio_i2c_class_init, }; static void bitbang_i2c_register(void) |