[PATCH v3 02/12] mmc: meson-gx: fix deferred probing

Sergey Shtylyov s.shtylyov at omp.ru
Sat Jun 17 13:36:12 PDT 2023


The driver overrides the error codes and IRQ0 returned by platform_get_irq()
to -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe
permanently instead of the deferred probing. Switch to propagating the error
codes upstream.  Since commit ce753ad1549c ("platform: finally disallow IRQ0
in platform_get_irq() and its ilk") IRQ0 is no longer returned by those APIs,
so we now can safely ignore it...

Fixes: cbcaac6d7dd2 ("mmc: meson-gx-mmc: Fix platform_get_irq's error checking")
Cc: stable at vger.kernel.org # v5.19+
Signed-off-by: Sergey Shtylyov <s.shtylyov at omp.ru>
Reviewed-by: Neil Armstrong <neil.armstrong at linaro.org>
---
Changes in version 3:
- added the platform_get_irq() commit reference to the  patch description and
  the Cc: tag marking the 1st kernel version containing it;
- added Neil's tag .

Changes in version 2:
- updated the fix due to the surrounding code change;
- refreshed the patch;
- removed stray newline in the Fixes: tag;
- slightly reformatted the patch description.

 drivers/mmc/host/meson-gx-mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index b8514d9d5e73..75f97dce7ef3 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -1192,8 +1192,8 @@ static int meson_mmc_probe(struct platform_device *pdev)
 		return PTR_ERR(host->regs);
 
 	host->irq = platform_get_irq(pdev, 0);
-	if (host->irq <= 0)
-		return -EINVAL;
+	if (host->irq < 0)
+		return host->irq;
 
 	cd_irq = platform_get_irq_optional(pdev, 1);
 	mmc_gpio_set_cd_irq(mmc, cd_irq);
-- 
2.26.3




More information about the linux-amlogic mailing list