diff options
author | 2020-09-02 21:36:53 +0200 | |
---|---|---|
committer | 2020-09-07 09:16:31 +0200 | |
commit | b41123f4f57df6950f3316948989783bbdefa7e2 (patch) | |
tree | 7552a3e76520902e513146b5d507a4afd2bf43f5 /drivers/mmc | |
parent | mmc: sdhci-of-sparx5: Use proper printk format for dma_addr_t (diff) | |
download | linux-b41123f4f57df6950f3316948989783bbdefa7e2.tar.gz linux-b41123f4f57df6950f3316948989783bbdefa7e2.tar.bz2 linux-b41123f4f57df6950f3316948989783bbdefa7e2.zip |
mmc: sdhci-brcmstb: Simplify with optional clock and dev_err_probe()
Only -ENOENT from devm_clk_get() means that clock is not present in
device tree. Other errors have their own meaning and should not be
ignored.
Simplify getting the clock which is in fact optional and also use
dev_err_probe() for handling deferred.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20200902193658.20539-7-krzk@kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/sdhci-brcmstb.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/mmc/host/sdhci-brcmstb.c b/drivers/mmc/host/sdhci-brcmstb.c index ad01f6451a95..876668827580 100644 --- a/drivers/mmc/host/sdhci-brcmstb.c +++ b/drivers/mmc/host/sdhci-brcmstb.c @@ -235,13 +235,11 @@ static int sdhci_brcmstb_probe(struct platform_device *pdev) dev_dbg(&pdev->dev, "Probe found match for %s\n", match->compatible); - clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(clk)) { - if (PTR_ERR(clk) == -EPROBE_DEFER) - return -EPROBE_DEFER; - dev_err(&pdev->dev, "Clock not found in Device Tree\n"); - clk = NULL; - } + clk = devm_clk_get_optional(&pdev->dev, NULL); + if (IS_ERR(clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(clk), + "Failed to get clock from Device Tree\n"); + res = clk_prepare_enable(clk); if (res) return res; |