From: YueHaibing <yuehaibing@huawei.com>
To: <myungjoo.ham@samsung.com>, <kyungmin.park@samsung.com>,
<cw00.choi@samsung.com>, <shawnguo@kernel.org>,
<s.hauer@pengutronix.de>, <kernel@pengutronix.de>,
<festevam@gmail.com>, <linux-imx@nxp.com>
Cc: YueHaibing <yuehaibing@huawei.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org
Subject: [PATCH -next] PM / devfreq: imx8m-ddrc: Fix inconsistent IS_ERR and PTR_ERR
Date: Mon, 30 Dec 2019 16:47:31 +0800 [thread overview]
Message-ID: <20191230084731.15776-1-yuehaibing@huawei.com> (raw)
Fix inconsistent IS_ERR and PTR_ERR in imx8m_ddrc_probe().
Detected using Coccinelle.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/devfreq/imx8m-ddrc.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/drivers/devfreq/imx8m-ddrc.c b/drivers/devfreq/imx8m-ddrc.c
index 53df792..bc82d36 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;
}
--
2.7.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2019-12-30 8:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-30 8:47 YueHaibing [this message]
2019-12-30 17:35 ` [PATCH -next] PM / devfreq: imx8m-ddrc: Fix inconsistent IS_ERR and PTR_ERR Chanwoo Choi
2019-12-30 18:08 ` Chanwoo Choi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191230084731.15776-1-yuehaibing@huawei.com \
--to=yuehaibing@huawei.com \
--cc=cw00.choi@samsung.com \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=kyungmin.park@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).