aboutsummaryrefslogtreecommitdiff
path: root/hw/display
diff options
context:
space:
mode:
Diffstat (limited to 'hw/display')
-rw-r--r--hw/display/ati.c5
-rw-r--r--hw/display/sm501.c5
-rw-r--r--hw/display/xlnx_dp.c5
3 files changed, 7 insertions, 8 deletions
diff --git a/hw/display/ati.c b/hw/display/ati.c
index 1d9df92..7216f7e 100644
--- a/hw/display/ati.c
+++ b/hw/display/ati.c
@@ -933,10 +933,9 @@ static void ati_vga_realize(PCIDevice *dev, Error **errp)
/* ddc, edid */
I2CBus *i2cbus = i2c_init_bus(DEVICE(s), "ati-vga.ddc");
bitbang_i2c_init(&s->bbi2c, i2cbus);
- I2CSlave *i2cddc = I2C_SLAVE(qdev_create(BUS(i2cbus), TYPE_I2CDDC));
+ I2CSlave *i2cddc = I2C_SLAVE(qdev_new(TYPE_I2CDDC));
i2c_set_slave_address(i2cddc, 0x50);
- object_property_set_bool(OBJECT(i2cddc), true, "realized",
- &error_abort);
+ qdev_realize_and_unref(DEVICE(i2cddc), BUS(i2cbus), &error_abort);
/* mmio register space */
memory_region_init_io(&s->mm, OBJECT(s), &ati_mm_ops, s,
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index 7ff14fd4..3e62eca 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -1831,10 +1831,9 @@ static void sm501_init(SM501State *s, DeviceState *dev,
/* i2c */
s->i2c_bus = i2c_init_bus(dev, "sm501.i2c");
/* ddc */
- I2CDDCState *ddc = I2CDDC(qdev_create(BUS(s->i2c_bus), TYPE_I2CDDC));
+ I2CDDCState *ddc = I2CDDC(qdev_new(TYPE_I2CDDC));
i2c_set_slave_address(I2C_SLAVE(ddc), 0x50);
- object_property_set_bool(OBJECT(ddc), true, "realized",
- &error_abort);
+ qdev_realize_and_unref(DEVICE(ddc), BUS(s->i2c_bus), &error_abort);
/* mmio */
memory_region_init(&s->mmio_region, OBJECT(dev), "sm501.mmio", MMIO_SIZE);
diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c
index 5210412..6e97935 100644
--- a/hw/display/xlnx_dp.c
+++ b/hw/display/xlnx_dp.c
@@ -1252,7 +1252,7 @@ static void xlnx_dp_init(Object *obj)
s->dpcd = DPCD(aux_create_slave(s->aux_bus, "dpcd"));
object_property_add_child(OBJECT(s), "dpcd", OBJECT(s->dpcd));
- s->edid = I2CDDC(qdev_create(BUS(aux_get_i2c_bus(s->aux_bus)), "i2c-ddc"));
+ s->edid = I2CDDC(qdev_new("i2c-ddc"));
i2c_set_slave_address(I2C_SLAVE(s->edid), 0x50);
object_property_add_child(OBJECT(s), "edid", OBJECT(s->edid));
@@ -1271,7 +1271,8 @@ static void xlnx_dp_realize(DeviceState *dev, Error **errp)
qdev_init_nofail(DEVICE(s->dpcd));
aux_map_slave(AUX_SLAVE(s->dpcd), 0x0000);
- qdev_init_nofail(DEVICE(s->edid));
+ qdev_realize_and_unref(DEVICE(s->edid), BUS(aux_get_i2c_bus(s->aux_bus)),
+ &error_fatal);
s->console = graphic_console_init(dev, 0, &xlnx_dp_gfx_ops, s);
surface = qemu_console_surface(s->console);