From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Yang Yingliang <yangyingliang@huawei.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: xiaolei.wang@windriver.com, alexander.stein@ew.tq-group.com,
shawnguo@kernel.org, s.hauer@pengutronix.de, linux-imx@nxp.com,
kernel@pengutronix.de, festevam@gmail.com,
l.stach@pengutronix.de
Subject: Re: [PATCH v2] soc: imx8m: fix wrong return value check of of_clk_get_by_name()
Date: Wed, 4 Jan 2023 10:19:28 +0100 [thread overview]
Message-ID: <31d7df1d-f77e-94df-942e-3d703c414a76@pengutronix.de> (raw)
In-Reply-To: <20230104092702.2553290-1-yangyingliang@huawei.com>
On 04.01.23 10:27, Yang Yingliang wrote:
> of_clk_get_by_name() never returns NULL pointer, it will return
> ERR_PTR() when it fails, so replace the check with IS_ERR().
>
> Fixes: 836fb30949d9 ("soc: imx8m: Enable OCOTP clock before reading the register")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> v1 -> v2:
> Check WARN_ON() instead of checking IS_ERR().
> ---
> drivers/soc/imx/soc-imx8m.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/soc/imx/soc-imx8m.c b/drivers/soc/imx/soc-imx8m.c
> index 28144c699b0c..d1dbe318be53 100644
> --- a/drivers/soc/imx/soc-imx8m.c
> +++ b/drivers/soc/imx/soc-imx8m.c
> @@ -66,10 +66,8 @@ static u32 __init imx8mq_soc_revision(void)
> ocotp_base = of_iomap(np, 0);
> WARN_ON(!ocotp_base);
> clk = of_clk_get_by_name(np, NULL);
> - if (!clk) {
> - WARN_ON(!clk);
> + if (WARN_ON(IS_ERR(clk)))
> return 0;
> - }
>
> clk_prepare_enable(clk);
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2023-01-04 9:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-04 9:27 Yang Yingliang
2023-01-04 9:19 ` Ahmad Fatoum [this message]
2023-01-04 9:30 ` Alexander Stein
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=31d7df1d-f77e-94df-942e-3d703c414a76@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=alexander.stein@ew.tq-group.com \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=l.stach@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=xiaolei.wang@windriver.com \
--cc=yangyingliang@huawei.com \
/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
all inboxes | Powered by JetHome®