summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2018-06-14 13:21:48 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2018-06-21 11:36:24 +0200
commitfdd4e344c877c2d6f569afdaa8addce003e76be6 (patch)
tree214b66067eed9f7e1c4439d80c2d87e58bed9424
parentde2aa91aa082ed2000bb4e43d807b07e68160ead (diff)
mmc: fix idx assigning for not aliased sdhci host controllers
Forward porting of 35928d6c6a to 6e9e049fa introduced a bug for host controllers which are not aliased in the device tree. Instead of instantiating the driver it fails with: sdhci-esdhc-imx 2194000.usdhc: sdhci_pltfm_init failed -12 sdhci-esdhc-imx: probe of 2194000.usdhc failed with error -12 Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
-rw-r--r--drivers/mmc/core/host.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index f0dcddc34997..40dbe3c5fda7 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -379,7 +379,7 @@ again:
err = ida_get_new_above(&mmc_host_ida, min_idx, &host->index);
if (!err) {
- if (host->index > max_idx) {
+ if (max_idx && (host->index > max_idx)) {
ida_remove(&mmc_host_ida, host->index);
err = -ENOSPC;
}