diff options
author | Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com> | 2021-01-14 23:26:55 +0800 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2021-02-01 11:54:46 +0100 |
commit | ffd68f356e411f79d5d448908a1f60e374c95cb2 (patch) | |
tree | 895fc453ed656c9ad6b76693397d868454ce15f7 /drivers | |
parent | 2ff0b85d627f6a3b96b35abb0be303bd1a690fe6 (diff) |
mmc: sdhci-of-arasan: Use dev_err_probe() to avoid spamming logs
Using dev_err_probe() can avoid spamming logs when probe is deferred.
This function can also help to reduce code the size, uniform error handling
and simplify the code.
Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://lore.kernel.org/r/20210114152700.21916-5-muhammad.husaini.zulkifli@intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/host/sdhci-of-arasan.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index 1080195e487d..839965f7c717 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -1544,15 +1544,14 @@ static int sdhci_arasan_probe(struct platform_device *pdev) sdhci_arasan->clk_ahb = devm_clk_get(dev, "clk_ahb"); if (IS_ERR(sdhci_arasan->clk_ahb)) { - dev_err(dev, "clk_ahb clock not found.\n"); - ret = PTR_ERR(sdhci_arasan->clk_ahb); + ret = dev_err_probe(dev, PTR_ERR(sdhci_arasan->clk_ahb), + "clk_ahb clock not found.\n"); goto err_pltfm_free; } clk_xin = devm_clk_get(dev, "clk_xin"); if (IS_ERR(clk_xin)) { - dev_err(dev, "clk_xin clock not found.\n"); - ret = PTR_ERR(clk_xin); + ret = dev_err_probe(dev, PTR_ERR(clk_xin), "clk_xin clock not found.\n"); goto err_pltfm_free; } @@ -1605,8 +1604,7 @@ static int sdhci_arasan_probe(struct platform_device *pdev) ret = mmc_of_parse(host->mmc); if (ret) { - if (ret != -EPROBE_DEFER) - dev_err(dev, "parsing dt failed (%d)\n", ret); + ret = dev_err_probe(dev, ret, "parsing dt failed.\n"); goto unreg_clk; } @@ -1614,8 +1612,8 @@ static int sdhci_arasan_probe(struct platform_device *pdev) if (of_device_is_compatible(np, "arasan,sdhci-5.1")) { sdhci_arasan->phy = devm_phy_get(dev, "phy_arasan"); if (IS_ERR(sdhci_arasan->phy)) { - ret = PTR_ERR(sdhci_arasan->phy); - dev_err(dev, "No phy for arasan,sdhci-5.1.\n"); + ret = dev_err_probe(dev, PTR_ERR(sdhci_arasan->phy), + "No phy for arasan,sdhci-5.1.\n"); goto unreg_clk; } |