All of lore.kernel.org
 help / color / mirror / Atom feed
From: cgel.zte@gmail.com
To: linus.walleij@linaro.org, govindraj.raja@imgtec.com
Cc: Damien.Horsley@imgtec.com, abrestic@chromium.org,
	ezequiel.garcia@imgtec.com, linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org, Lv Ruyi <lv.ruyi@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: [PATCH] pinctrl: fix error check return value of irq_of_parse_and_map()
Date: Fri, 22 Apr 2022 08:52:40 +0000	[thread overview]
Message-ID: <20220422085240.2776527-1-lv.ruyi@zte.com.cn> (raw)

From: Lv Ruyi <lv.ruyi@zte.com.cn>

The irq_of_parse_and_map() function returns 0 on failure, and does not
return an negative value.

Fixes: 	cefc03e5995e ("pinctrl: Add Pistachio SoC pin control driver")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
 drivers/pinctrl/pinctrl-pistachio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-pistachio.c b/drivers/pinctrl/pinctrl-pistachio.c
index 8d271c6b0ca4..ff34f9755368 100644
--- a/drivers/pinctrl/pinctrl-pistachio.c
+++ b/drivers/pinctrl/pinctrl-pistachio.c
@@ -1374,7 +1374,7 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl)
 		}
 
 		irq = irq_of_parse_and_map(child, 0);
-		if (irq < 0) {
+		if (!irq) {
 			dev_err(pctl->dev, "No IRQ for bank %u: %d\n", i, irq);
 			of_node_put(child);
 			ret = irq;
-- 
2.25.1


             reply	other threads:[~2022-04-22  8:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22  8:52 cgel.zte [this message]
2022-04-24  3:14 ` [PATCH v2] pinctrl: fix error check return value of irq_of_parse_and_map() cgel.zte
2022-04-24 14:25   ` 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=20220422085240.2776527-1-lv.ruyi@zte.com.cn \
    --to=cgel.zte@gmail.com \
    --cc=Damien.Horsley@imgtec.com \
    --cc=abrestic@chromium.org \
    --cc=ezequiel.garcia@imgtec.com \
    --cc=govindraj.raja@imgtec.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lv.ruyi@zte.com.cn \
    --cc=zealci@zte.com.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.