Skip to contentSkip to conversation

mmc: tegra: suppress errors when probe is deferred

PATCH In review Timo Alho 3 participants 3 messages Aug 17, 2017 – Aug 22, 2017

Subsystems (3)
lore
Share & tools
lore

Timo Alho

author
#0 lore raw

PATCH 1/1 mmc: tegra: suppress errors when probe is deferred

Don't print error message when clk_get() returns -EPROBE_DEFER. On recent Tegra chips (t186 onwards), the clocks are provided by auxiliary microprocessor (bpmp) and until the driver for it is probed clocks are not available.

While at it, change the real error message more meaningful.

---
 drivers/mmc/host/sdhci-tegra.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +3 -1
index f668a6f..cdde9ff 100644
@@ -501,8 +501,10 @@ static int sdhci_tegra_probe(struct platform_device *pdev)
 
 	clk = devm_clk_get(mmc_dev(host->mmc), NULL);
 	if (IS_ERR(clk)) {
-		dev_err(mmc_dev(host->mmc), "clk err\n");
 		rc = PTR_ERR(clk);
+		if (rc != -EPROBE_DEFER)
+			dev_err(&pdev->dev,
+				"failed to get controller clock: %d\n", rc);
 		goto err_clk_get;
 	}
 	clk_prepare_enable(clk);
Signature · 1 line
2.7.4
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Timo Alho

Don't print error message when clk_get() returns -EPROBE_DEFER. On recent Tegra chips (t186 onwards), the clocks are provided by auxiliary microprocessor (bpmp) and until the driver for it is probed clocks are not available.

While at it, change the real error message more meaningful.

One comment below, nevertheless:

Quoted 9 lines
---
 drivers/mmc/host/sdhci-tegra.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +0 -0
index f668a6f..cdde9ff 100644

drivers/mmc/host/sdhci-tegra.c static int sdhci_tegra_probe(struct platform_device *pdev) · line 506

Quoted 7 lines
drivers/mmc/host/sdhci-tegra.c +2 -1
@@ -501,8 +501,10 @@ static int sdhci_tegra_probe(struct platform_device *pdev)
 
 	clk = devm_clk_get(mmc_dev(host->mmc), NULL);
 	if (IS_ERR(clk)) {
-		dev_err(mmc_dev(host->mmc), "clk err\n");
 		rc = PTR_ERR(clk);
+		if (rc != -EPROBE_DEFER)
+			dev_err(&pdev->dev,

Looks a bit weird sometimes using mmc_dev(host->mmc) and sometimes &pdev->dev.

Quoted 5 lines
drivers/mmc/host/sdhci-tegra.c +1 -0
+				"failed to get controller clock: %d\n", rc);
 		goto err_clk_get;
 	}
 	clk_prepare_enable(clk);
#2 lore raw
In reply to Timo Alho
Quoted 17 lines · Timo Alho

Don't print error message when clk_get() returns -EPROBE_DEFER. On recent Tegra chips (t186 onwards), the clocks are provided by auxiliary microprocessor (bpmp) and until the driver for it is probed clocks are not available.

While at it, change the real error message more meaningful.

---
 drivers/mmc/host/sdhci-tegra.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +0 -0
index f668a6f..cdde9ff 100644

drivers/mmc/host/sdhci-tegra.c static int sdhci_tegra_probe(struct platform_device *pdev) · line 507

Quoted 8 lines
drivers/mmc/host/sdhci-tegra.c +3 -1
@@ -501,8 +501,10 @@ static int sdhci_tegra_probe(struct platform_device *pdev)
 
        clk = devm_clk_get(mmc_dev(host->mmc), NULL);
        if (IS_ERR(clk)) {
-               dev_err(mmc_dev(host->mmc), "clk err\n");
                rc = PTR_ERR(clk);
+               if (rc != -EPROBE_DEFER)
+                       dev_err(&pdev->dev,
+                               "failed to get controller clock: %d\n", rc);

There is no need to print an error in any case, as the common clk framework deals with relevant error printing.

Quoted 6 lines
drivers/mmc/host/sdhci-tegra.c +0 -1
                goto err_clk_get;
        }
        clk_prepare_enable(clk);
--

2.7.4

Kind regards
Uffe