Skip to contentSkip to conversation

mmc: sdhci-of-k1: Fix error code in probe()

PATCH In review Dan Carpenter 4 participants 4 messages May 27, 2025 – Jun 9, 2025

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: sdhci-of-k1: Fix error code in probe()

If spacemit_sdhci_get_clocks() fails, then propagate the error code. Don't return success.

Fixes e5502d15b0f3 ("mmc: sdhci-of-k1: add support for SpacemiT K1 SoC")
---
 drivers/mmc/host/sdhci-of-k1.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-of-k1.c +2 -1
index 6880d3e9ab62..2e5da7c5834c 100644
@@ -276,7 +276,8 @@ static int spacemit_sdhci_probe(struct platform_device *pdev)
 
 	host->mmc->caps |= MMC_CAP_NEED_RSP_BUSY;
 
-	if (spacemit_sdhci_get_clocks(dev, pltfm_host))
+	ret = spacemit_sdhci_get_clocks(dev, pltfm_host);
+	if (ret)
 		goto err_pltfm;
 
 	ret = sdhci_add_host(host);
Signature · 1 line
2.47.2
Reviewed-by on v1 1/1
#1 lore raw

Hi Dan,

Quoted 26 lines · Dan Carpenter

If spacemit_sdhci_get_clocks() fails, then propagate the error code. Don't return success.

Fixes e5502d15b0f3 ("mmc: sdhci-of-k1: add support for SpacemiT K1 SoC")
---
 drivers/mmc/host/sdhci-of-k1.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-of-k1.c +2 -1
index 6880d3e9ab62..2e5da7c5834c 100644
@@ -276,7 +276,8 @@ static int spacemit_sdhci_probe(struct platform_device *pdev)
 
 	host->mmc->caps |= MMC_CAP_NEED_RSP_BUSY;
 
-	if (spacemit_sdhci_get_clocks(dev, pltfm_host))
+	ret = spacemit_sdhci_get_clocks(dev, pltfm_host);
+	if (ret)
 		goto err_pltfm;
 
 	ret = sdhci_add_host(host);
Signature · 1 line
2.47.2

Thanks for catching this..

Signature · 1 line
Yixun Lan (dlan)
maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Dan Carpenter
Quoted 5 lines · Dan Carpenter

If spacemit_sdhci_get_clocks() fails, then propagate the error code. Don't return success.

Fixes e5502d15b0f3 ("mmc: sdhci-of-k1: add support for SpacemiT K1 SoC")
Quoted 18 lines
---
 drivers/mmc/host/sdhci-of-k1.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-of-k1.c +2 -1
index 6880d3e9ab62..2e5da7c5834c 100644
@@ -276,7 +276,8 @@ static int spacemit_sdhci_probe(struct platform_device *pdev)
 
 	host->mmc->caps |= MMC_CAP_NEED_RSP_BUSY;
 
-	if (spacemit_sdhci_get_clocks(dev, pltfm_host))
+	ret = spacemit_sdhci_get_clocks(dev, pltfm_host);
+	if (ret)
 		goto err_pltfm;
 
 	ret = sdhci_add_host(host);
#3 lore raw
In reply to Dan Carpenter
Quoted 6 lines · Dan Carpenter

If spacemit_sdhci_get_clocks() fails, then propagate the error code. Don't return success.

Fixes e5502d15b0f3 ("mmc: sdhci-of-k1: add support for SpacemiT K1 SoC")

Applied for fixes, thanks!

Kind regards
Uffe

Quoted 21 lines
---
 drivers/mmc/host/sdhci-of-k1.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-of-k1.c +2 -2
index 6880d3e9ab62..2e5da7c5834c 100644
@@ -276,7 +276,8 @@ static int spacemit_sdhci_probe(struct platform_device *pdev)
 
        host->mmc->caps |= MMC_CAP_NEED_RSP_BUSY;
 
-       if (spacemit_sdhci_get_clocks(dev, pltfm_host))
+       ret = spacemit_sdhci_get_clocks(dev, pltfm_host);
+       if (ret)
                goto err_pltfm;
 
        ret = sdhci_add_host(host);
--

2.47.2