Commit 756f739b authored by Philippe Mathieu-Daudé's avatar Philippe Mathieu-Daudé Committed by Peter Maydell
Browse files

hw/arm/aspeed: Do not create and attach empty SD cards by default



Since added in commit 2bea128c, each SDHCI is wired with a SD
card, using empty card when no block drive provided. This is not
the desired behavior. The SDHCI exposes a SD bus to plug cards
on, if no card available, it is fine to have an unplugged bus.

Avoid creating unnecessary SD card device when no block drive
provided.

Fixes: 2bea128c ("hw/sd/aspeed_sdhci: New device")
Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20200705173402.15620-1-f4bug@amsat.org
Reviewed-by: default avatarCédric Le Goater <clg@kaod.org>
Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parent ad938fc1
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -246,11 +246,12 @@ static void sdhci_attach_drive(SDHCIState *sdhci, DriveInfo *dinfo)
{
        DeviceState *card;

        if (!dinfo) {
            return;
        }
        card = qdev_new(TYPE_SD_CARD);
        if (dinfo) {
        qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo),
                                &error_fatal);
        }
        qdev_realize_and_unref(card,
                               qdev_get_child_bus(DEVICE(sdhci), "sd-bus"),
                               &error_fatal);