]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mmc: davinci: fix mmc_add_host order in probe
authorOsama Abdelkader <osama.abdelkader@gmail.com>
Sun, 10 May 2026 16:29:39 +0000 (18:29 +0200)
committerUlf Hansson <ulfh@kernel.org>
Fri, 29 May 2026 12:15:58 +0000 (14:15 +0200)
mmc_add_host() makes the host visible to the MMC core. Register the
interrupt handlers and advertise MMC_CAP_SDIO_IRQ before that, so the
core cannot start using the host before IRQ handling is set up.

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
drivers/mmc/host/davinci_mmc.c

index 42ad87aa48f59059a8f220840fe57e9c914cebb1..cdb9fa94b56d065e52dc2974b0e8d0e82c1e8688 100644 (file)
@@ -1294,14 +1294,10 @@ static int davinci_mmcsd_probe(struct platform_device *pdev)
                goto cpu_freq_fail;
        }
 
-       ret = mmc_add_host(mmc);
-       if (ret < 0)
-               goto mmc_add_host_fail;
-
        ret = devm_request_irq(&pdev->dev, irq, mmc_davinci_irq, 0,
                               mmc_hostname(mmc), host);
        if (ret)
-               goto request_irq_fail;
+               goto mmc_add_host_fail;
 
        if (host->sdio_irq >= 0) {
                ret = devm_request_irq(&pdev->dev, host->sdio_irq,
@@ -1311,6 +1307,10 @@ static int davinci_mmcsd_probe(struct platform_device *pdev)
                        mmc->caps |= MMC_CAP_SDIO_IRQ;
        }
 
+       ret = mmc_add_host(mmc);
+       if (ret < 0)
+               goto mmc_add_host_fail;
+
        rename_region(mem, mmc_hostname(mmc));
 
        if (mmc->caps & MMC_CAP_8_BIT_DATA)
@@ -1324,8 +1324,6 @@ static int davinci_mmcsd_probe(struct platform_device *pdev)
 
        return 0;
 
-request_irq_fail:
-       mmc_remove_host(mmc);
 mmc_add_host_fail:
        mmc_davinci_cpufreq_deregister(host);
 cpu_freq_fail: