diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-24 13:12:29 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-27 10:50:50 -0600 |
commit | 999e12bbe85c5dcf49bef13bce4f97399c7105f4 (patch) | |
tree | 73b6ed8633a73134e9f728baa1ed2b1dab58b5b0 /hw/bitbang_i2c.c | |
parent | 40021f08882aaef93c66c8c740087b6d3031b63a (diff) |
sysbus: apic: ioapic: convert to QEMU Object Model
This converts three devices because apic and ioapic are subclasses of sysbus.
Converting subclasses independently of their base class is prohibitively hard.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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) |