summaryrefslogtreecommitdiff
path: root/hw/display/sm501.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2020-06-10 07:31:59 +0200
committerMarkus Armbruster <armbru@redhat.com>2020-06-15 22:05:08 +0200
commitdf70796916ebbafe262a01c1c4dc6d7af805de24 (patch)
tree67c5b6e80f36502d9e653f4ae826b9304d1d95de /hw/display/sm501.c
parent3e80f6902c13f6edb6675c0f33edcbbf0163ec32 (diff)
downloadqemu-df70796916ebbafe262a01c1c4dc6d7af805de24.zip
qdev: Convert uses of qdev_create() manually
Same transformation as in the previous commit. Manual, because convincing Coccinelle to transform these cases is somewhere between not worthwhile and infeasible (at least for me). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20200610053247.1583243-11-armbru@redhat.com>
Diffstat (limited to 'hw/display/sm501.c')
-rw-r--r--hw/display/sm501.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index 7ff14fd474..3e62eca3de 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);