@@ -1297,7 +1297,7 @@ static void musicpal_init(MachineState *machine)
dev = sysbus_create_simple(TYPE_MUSICPAL_GPIO, MP_GPIO_BASE,
qdev_get_gpio_in(pic, MP_GPIO_IRQ));
- i2c_dev = sysbus_create_simple(TYPE_GPIO_I2C, -1, NULL);
+ i2c_dev = qdev_create_simple(TYPE_GPIO_I2C, &error_fatal);
i2c = (I2CBus *)qdev_get_child_bus(i2c_dev, "i2c");
lcd_dev = sysbus_create_simple(TYPE_MUSICPAL_LCD, MP_LCD_BASE, NULL);
@@ -13,7 +13,6 @@
#include "qemu/osdep.h"
#include "hw/irq.h"
#include "hw/i2c/bitbang_i2c.h"
-#include "hw/sysbus.h"
#include "qemu/module.h"
#include "qom/object.h"
#include "trace.h"
@@ -191,7 +190,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(GPIOI2CState, GPIO_I2C)
struct GPIOI2CState {
/*< private >*/
- SysBusDevice parent_obj;
+ DeviceState parent_obj;
/*< public >*/
bitbang_i2c_interface bitbang;
@@ -233,7 +232,7 @@ static void gpio_i2c_class_init(ObjectClass *klass, void *data)
static const TypeInfo gpio_i2c_info = {
.name = TYPE_GPIO_I2C,
- .parent = TYPE_SYS_BUS_DEVICE,
+ .parent = TYPE_DEVICE,
.instance_size = sizeof(GPIOI2CState),
.instance_init = gpio_i2c_init,
.class_init = gpio_i2c_class_init,
Nothing in TYPE_GPIO_I2C access the SysBus API, convert it to a plain QDev. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- hw/arm/musicpal.c | 2 +- hw/i2c/bitbang_i2c.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-)