[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 25/25] hw/arm/aspeed: Do not create and attach empty SD cards by d
From: |
Peter Maydell |
Subject: |
[PULL 25/25] hw/arm/aspeed: Do not create and attach empty SD cards by default |
Date: |
Mon, 13 Jul 2020 15:11:04 +0100 |
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Since added in commit 2bea128c3d, 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: 2bea128c3d ("hw/sd/aspeed_sdhci: New device")
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20200705173402.15620-1-f4bug@amsat.org
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/arm/aspeed.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 660dcb54144..6a3a345a6f6 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -246,11 +246,12 @@ static void sdhci_attach_drive(SDHCIState *sdhci,
DriveInfo *dinfo)
{
DeviceState *card;
- card = qdev_new(TYPE_SD_CARD);
- if (dinfo) {
- qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo),
- &error_fatal);
+ if (!dinfo) {
+ return;
}
+ card = qdev_new(TYPE_SD_CARD);
+ 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);
--
2.20.1
- [PULL 15/25] util/oslib-posix.c: Implement qemu_init_exec_dir() for Haiku, (continued)
- [PULL 15/25] util/oslib-posix.c: Implement qemu_init_exec_dir() for Haiku, Peter Maydell, 2020/07/13
- [PULL 16/25] util/drm: make portable by avoiding struct dirent d_type, Peter Maydell, 2020/07/13
- [PULL 18/25] target/nios2: in line the semantics of DISAS_UPDATE with other targets, Peter Maydell, 2020/07/13
- [PULL 17/25] target/nios2: add DISAS_NORETURN case for nothing more to generate, Peter Maydell, 2020/07/13
- [PULL 22/25] hw/arm/tosa: Encapsulate misc GPIO handling in a device, Peter Maydell, 2020/07/13
- [PULL 21/25] hw/arm/tosa.c: Detabify, Peter Maydell, 2020/07/13
- [PULL 23/25] hw/arm/palm.c: Detabify, Peter Maydell, 2020/07/13
- [PULL 19/25] target/nios2: Use gen_io_start around wrctl instruction, Peter Maydell, 2020/07/13
- [PULL 20/25] hw/nios2: exit to main CPU loop only when unmasking interrupts, Peter Maydell, 2020/07/13
- [PULL 24/25] hw/arm/palm.c: Encapsulate misc GPIO handling in a device, Peter Maydell, 2020/07/13
- [PULL 25/25] hw/arm/aspeed: Do not create and attach empty SD cards by default,
Peter Maydell <=
- Re: [PULL 00/25] target-arm queue, Peter Maydell, 2020/07/13