linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yongjun <weiyj.lk@gmail.com>
To: Jesper Nilsson <jesper.nilsson@axis.com>,
	Lars Persson <lars.persson@axis.com>,
	Niklas Cassel <niklas.cassel@axis.com>,
	Linus Walleij <linus.walleij@linaro.org>
Cc: Wei Yongjun <weiyongjun1@huawei.com>,
	linux-arm-kernel@axis.com, linux-gpio@vger.kernel.org
Subject: [PATCH -next v2] pinctrl: artpec6: Fix return value check in artpec6_pmx_probe()
Date: Tue, 25 Apr 2017 11:29:30 +0000	[thread overview]
Message-ID: <20170425112930.19555-1-weiyj.lk@gmail.com> (raw)
In-Reply-To: <20170425032945.22157-1-weiyj.lk@gmail.com>

From: Wei Yongjun <weiyongjun1@huawei.com>

In case of error, the function pinctrl_register() returns
ERR_PTR() not NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
v1 -> v2: fix comment
---
 drivers/pinctrl/pinctrl-artpec6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-artpec6.c b/drivers/pinctrl/pinctrl-artpec6.c
index b5a2eff..6a16019 100644
--- a/drivers/pinctrl/pinctrl-artpec6.c
+++ b/drivers/pinctrl/pinctrl-artpec6.c
@@ -938,9 +938,9 @@ static int artpec6_pmx_probe(struct platform_device *pdev)
 	pmx->num_pin_groups = ARRAY_SIZE(artpec6_pin_groups);
 	pmx->pctl	    = pinctrl_register(&artpec6_desc, &pdev->dev, pmx);
 
-	if (!pmx->pctl) {
+	if (IS_ERR(pmx->pctl)) {
 		dev_err(&pdev->dev, "could not register pinctrl driver\n");
-		return -EINVAL;
+		return PTR_ERR(pmx->pctl);
 	}
 
 	platform_set_drvdata(pdev, pmx);


  parent reply	other threads:[~2017-04-25 11:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-25  3:29 [PATCH -next] pinctrl: artpec6: Fix return value check in artpec6_pmx_probe() Wei Yongjun
2017-04-25  8:31 ` Jesper Nilsson
2017-04-25  9:18   ` weiyongjun (A)
2017-04-25 11:29 ` Wei Yongjun [this message]
2017-04-25 13:40   ` [PATCH -next v2] " Jesper Nilsson
2017-04-28  7:43     ` Linus Walleij
2017-04-28  7:58       ` Jesper Nilsson
2017-04-28 14:26         ` Tony Lindgren
2017-04-28  7:41   ` Linus Walleij

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=20170425112930.19555-1-weiyj.lk@gmail.com \
    --to=weiyj.lk@gmail.com \
    --cc=jesper.nilsson@axis.com \
    --cc=lars.persson@axis.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@axis.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=niklas.cassel@axis.com \
    --cc=weiyongjun1@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;
as well as URLs for NNTP newsgroup(s).