public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	Paul Cercueil <paul@crapouillou.net>
Cc: linux-gpio@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] pinctrl: ingenic: checking for NULL instead of IS_ERR()
Date: Wed, 14 Jun 2017 09:12:09 +0000	[thread overview]
Message-ID: <20170614091209.GC29394@elgon.mountain> (raw)

devm_pinctrl_register() returns error pointers, it doesn't return NULL.

Fixes: b5c23aa46537 ("pinctrl: add a pinctrl driver for the Ingenic jz47xx SoCs")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c
index d8473d929cb1..d8e8842967d6 100644
--- a/drivers/pinctrl/pinctrl-ingenic.c
+++ b/drivers/pinctrl/pinctrl-ingenic.c
@@ -785,9 +785,9 @@ int ingenic_pinctrl_probe(struct platform_device *pdev)
 	}
 
 	jzpc->pctl = devm_pinctrl_register(dev, pctl_desc, jzpc);
-	if (!jzpc->pctl) {
+	if (IS_ERR(jzpc->pctl)) {
 		dev_err(dev, "Failed to register pinctrl\n");
-		return -EINVAL;
+		return PTR_ERR(jzpc->pctl);
 	}
 
 	for (i = 0; i < chip_info->num_groups; i++) {

             reply	other threads:[~2017-06-14  9:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14  9:12 Dan Carpenter [this message]
2017-06-20  9:36 ` [PATCH] pinctrl: ingenic: checking for NULL instead of IS_ERR() 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=20170614091209.GC29394@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=paul@crapouillou.net \
    /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