aboutsummaryrefslogtreecommitdiff
path: root/hw/sd
diff options
context:
space:
mode:
Diffstat (limited to 'hw/sd')
-rw-r--r--hw/sd/milkymist-memcard.c4
-rw-r--r--hw/sd/pxa2xx_mmci.c8
-rw-r--r--hw/sd/ssi-sd.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/hw/sd/milkymist-memcard.c b/hw/sd/milkymist-memcard.c
index 926e1af475..4cfdf7b64c 100644
--- a/hw/sd/milkymist-memcard.c
+++ b/hw/sd/milkymist-memcard.c
@@ -278,9 +278,9 @@ static void milkymist_memcard_realize(DeviceState *dev, Error **errp)
/* FIXME use a qdev drive property instead of drive_get_next() */
dinfo = drive_get_next(IF_SD);
blk = dinfo ? blk_by_legacy_dinfo(dinfo) : NULL;
- carddev = qdev_create(BUS(&s->sdbus), TYPE_SD_CARD);
+ carddev = qdev_new(TYPE_SD_CARD);
qdev_prop_set_drive(carddev, "drive", blk, &err);
- object_property_set_bool(OBJECT(carddev), true, "realized", &err);
+ qdev_realize_and_unref(carddev, BUS(&s->sdbus), &err);
if (err) {
error_setg(errp, "failed to init SD card: %s", error_get_pretty(err));
return;
diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c
index c32df1b8f9..89784407b9 100644
--- a/hw/sd/pxa2xx_mmci.c
+++ b/hw/sd/pxa2xx_mmci.c
@@ -485,23 +485,23 @@ PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem,
PXA2xxMMCIState *s;
Error *err = NULL;
- dev = qdev_create(NULL, TYPE_PXA2XX_MMCI);
+ dev = qdev_new(TYPE_PXA2XX_MMCI);
s = PXA2XX_MMCI(dev);
sbd = SYS_BUS_DEVICE(dev);
sysbus_mmio_map(sbd, 0, base);
sysbus_connect_irq(sbd, 0, irq);
qdev_connect_gpio_out_named(dev, "rx-dma", 0, rx_dma);
qdev_connect_gpio_out_named(dev, "tx-dma", 0, tx_dma);
- qdev_init_nofail(dev);
+ qdev_realize_and_unref(dev, NULL, &error_fatal);
/* Create and plug in the sd card */
- carddev = qdev_create(qdev_get_child_bus(dev, "sd-bus"), TYPE_SD_CARD);
+ carddev = qdev_new(TYPE_SD_CARD);
qdev_prop_set_drive(carddev, "drive", blk, &err);
if (err) {
error_reportf_err(err, "failed to init SD card: ");
return NULL;
}
- object_property_set_bool(OBJECT(carddev), true, "realized", &err);
+ qdev_realize_and_unref(carddev, qdev_get_child_bus(dev, "sd-bus"), &err);
if (err) {
error_reportf_err(err, "failed to init SD card: ");
return NULL;
diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c
index 829797b597..f98a6f3ae1 100644
--- a/hw/sd/ssi-sd.c
+++ b/hw/sd/ssi-sd.c
@@ -252,7 +252,7 @@ static void ssi_sd_realize(SSISlave *d, Error **errp)
/* Create and plug in the sd card */
/* FIXME use a qdev drive property instead of drive_get_next() */
dinfo = drive_get_next(IF_SD);
- carddev = qdev_create(BUS(&s->sdbus), TYPE_SD_CARD);
+ carddev = qdev_new(TYPE_SD_CARD);
if (dinfo) {
qdev_prop_set_drive(carddev, "drive", blk_by_legacy_dinfo(dinfo), &err);
if (err) {
@@ -265,7 +265,7 @@ static void ssi_sd_realize(SSISlave *d, Error **errp)
goto fail;
}
- object_property_set_bool(OBJECT(carddev), true, "realized", &err);
+ qdev_realize_and_unref(carddev, BUS(&s->sdbus), &err);
if (err) {
goto fail;
}