From: narmstrong@baylibre.com (Neil Armstrong)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] clk: Fix return value check in oxnas_stdclk_probe()
Date: Mon, 20 Jun 2016 12:03:54 +0200 [thread overview]
Message-ID: <5767BF8A.6080204@baylibre.com> (raw)
In-Reply-To: <1466184263-17890-1-git-send-email-weiyj_lk@163.com>
On 06/17/2016 07:24 PM, weiyj_lk at 163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> In case of error, the function syscon_node_to_regmap() returns
> ERR_PTR() and never returns NULL. The NULL test in the return
> value check should be replaced with IS_ERR().
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
> drivers/clk/clk-oxnas.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/clk-oxnas.c b/drivers/clk/clk-oxnas.c
> index efba7d4..79bcb2e 100644
> --- a/drivers/clk/clk-oxnas.c
> +++ b/drivers/clk/clk-oxnas.c
> @@ -144,9 +144,9 @@ static int oxnas_stdclk_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> regmap = syscon_node_to_regmap(of_get_parent(np));
> - if (!regmap) {
> + if (IS_ERR(regmap)) {
> dev_err(&pdev->dev, "failed to have parent regmap\n");
> - return -EINVAL;
> + return PTR_ERR(regmap);
> }
>
> for (i = 0; i < ARRAY_SIZE(clk_oxnas_init); i++) {
>
>
>
Correct.
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Thanks,
Neil
next prev parent reply other threads:[~2016-06-20 10:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-17 17:24 [PATCH] clk: Fix return value check in oxnas_stdclk_probe() weiyj_lk at 163.com
2016-06-20 10:03 ` Neil Armstrong [this message]
2016-06-21 0:00 ` Stephen Boyd
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=5767BF8A.6080204@baylibre.com \
--to=narmstrong@baylibre.com \
--cc=linux-arm-kernel@lists.infradead.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).