summaryrefslogtreecommitdiffstats
path: root/drivers/devfreq
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2019-12-30 16:47:31 +0800
committerChanwoo Choi <cw00.choi@samsung.com>2019-12-31 03:09:57 +0900
commit10800fec619d56acd04b1de86b6c3473bb04c2a8 (patch)
tree44be107f7ba2a920ae5ac32c8d2d08edef3e87ee /drivers/devfreq
parent28135762b83ab5767fecafb997f2dc760b7d2739 (diff)
downloadlinux-10800fec619d56acd04b1de86b6c3473bb04c2a8.tar.bz2
PM / devfreq: imx8m-ddrc: Fix inconsistent IS_ERR and PTR_ERR
Fix inconsistent IS_ERR and PTR_ERR in imx8m_ddrc_probe(). Detected using Coccinelle. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/devfreq')
-rw-r--r--drivers/devfreq/imx8m-ddrc.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/devfreq/imx8m-ddrc.c b/drivers/devfreq/imx8m-ddrc.c
index 53df7923d893..bc82d3653bff 100644
--- a/drivers/devfreq/imx8m-ddrc.c
+++ b/drivers/devfreq/imx8m-ddrc.c
@@ -395,15 +395,27 @@ static int imx8m_ddrc_probe(struct platform_device *pdev)
}
priv->dram_core = devm_clk_get(dev, "core");
+ if (IS_ERR(priv->dram_core)) {
+ ret = PTR_ERR(priv->dram_core);
+ dev_err(dev, "failed to fetch core clock: %d\n", ret);
+ return ret;
+ }
priv->dram_pll = devm_clk_get(dev, "pll");
+ if (IS_ERR(priv->dram_pll)) {
+ ret = PTR_ERR(priv->dram_pll);
+ dev_err(dev, "failed to fetch pll clock: %d\n", ret);
+ return ret;
+ }
priv->dram_alt = devm_clk_get(dev, "alt");
+ if (IS_ERR(priv->dram_alt)) {
+ ret = PTR_ERR(priv->dram_alt);
+ dev_err(dev, "failed to fetch alt clock: %d\n", ret);
+ return ret;
+ }
priv->dram_apb = devm_clk_get(dev, "apb");
- if (IS_ERR(priv->dram_core) ||
- IS_ERR(priv->dram_pll) ||
- IS_ERR(priv->dram_alt) ||
- IS_ERR(priv->dram_apb)) {
- ret = PTR_ERR(priv->devfreq);
- dev_err(dev, "failed to fetch clocks: %d\n", ret);
+ if (IS_ERR(priv->dram_apb)) {
+ ret = PTR_ERR(priv->dram_apb);
+ dev_err(dev, "failed to fetch apb clock: %d\n", ret);
return ret;
}