From fdd4e344c877c2d6f569afdaa8addce003e76be6 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Thu, 14 Jun 2018 13:21:48 +0200 Subject: 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 Acked-by: Marcel Ziswiler --- drivers/mmc/core/host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.3