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-12-09 23:11:27 +0100
commit7902806777c52b8fed89441cc016503556d08ea8 (patch)
tree6970dd6c9f19dde657776987c627d478e9ae2399
parentd161b866f456e96ded1894a97e9c0dde3843f332 (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;
}