提交 10800fec 编写于 作者: Y YueHaibing 提交者: Chanwoo Choi

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: NYueHaibing <yuehaibing@huawei.com>
Signed-off-by: NChanwoo Choi <cw00.choi@samsung.com>
上级 28135762
...@@ -395,15 +395,27 @@ static int imx8m_ddrc_probe(struct platform_device *pdev) ...@@ -395,15 +395,27 @@ static int imx8m_ddrc_probe(struct platform_device *pdev)
} }
priv->dram_core = devm_clk_get(dev, "core"); 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"); 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"); 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"); priv->dram_apb = devm_clk_get(dev, "apb");
if (IS_ERR(priv->dram_core) || if (IS_ERR(priv->dram_apb)) {
IS_ERR(priv->dram_pll) || ret = PTR_ERR(priv->dram_apb);
IS_ERR(priv->dram_alt) || dev_err(dev, "failed to fetch apb clock: %d\n", ret);
IS_ERR(priv->dram_apb)) {
ret = PTR_ERR(priv->devfreq);
dev_err(dev, "failed to fetch clocks: %d\n", ret);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册