diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2016-02-18 14:16:18 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-02-18 14:26:33 +0000 |
commit | eb4f566bbbe195b2475e8fa5d9ed29ca56a18b02 (patch) | |
tree | 781f6dbda950d1b831615cb4cebc267968fc0e69 /hw/sd/sdhci.c | |
parent | 40bbc194376758e8deabcb6f5bfd38bf73355a40 (diff) | |
download | qemu-eb4f566bbbe195b2475e8fa5d9ed29ca56a18b02.zip qemu-eb4f566bbbe195b2475e8fa5d9ed29ca56a18b02.tar.gz qemu-eb4f566bbbe195b2475e8fa5d9ed29ca56a18b02.tar.bz2 |
sdhci_sysbus: Create SD card device in users, not the device itself
Move the creation of the SD card device from the sdhci_sysbus
device itself into the boards that create these devices.
This allows us to remove the cannot_instantiate_with_device_add
notation because we no longer call drive_get_next in the device
model.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 1455646193-13238-7-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'hw/sd/sdhci.c')
-rw-r--r-- | hw/sd/sdhci.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 396dd10..73e7c87 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -1296,29 +1296,6 @@ static void sdhci_sysbus_realize(DeviceState *dev, Error ** errp) { SDHCIState *s = SYSBUS_SDHCI(dev); SysBusDevice *sbd = SYS_BUS_DEVICE(dev); - DriveInfo *di; - BlockBackend *blk; - DeviceState *carddev; - Error *err = NULL; - - /* Create and plug in the sd card. - * FIXME: this should be done by the users of this device so we - * do not use drive_get_next() here. - */ - di = drive_get_next(IF_SD); - blk = di ? blk_by_legacy_dinfo(di) : NULL; - - carddev = qdev_create(qdev_get_child_bus(dev, "sd-bus"), TYPE_SD_CARD); - qdev_prop_set_drive(carddev, "drive", blk, &err); - if (err) { - error_propagate(errp, err); - return; - } - object_property_set_bool(OBJECT(carddev), true, "realized", &err); - if (err) { - error_propagate(errp, err); - return; - } s->buf_maxsz = sdhci_get_fifolen(s); s->fifo_buffer = g_malloc0(s->buf_maxsz); @@ -1335,8 +1312,6 @@ static void sdhci_sysbus_class_init(ObjectClass *klass, void *data) dc->vmsd = &sdhci_vmstate; dc->props = sdhci_sysbus_properties; dc->realize = sdhci_sysbus_realize; - /* Reason: instance_init() method uses drive_get_next() */ - dc->cannot_instantiate_with_device_add_yet = true; } static const TypeInfo sdhci_sysbus_info = { |