All of lore.kernel.org
 help / color / mirror / Atom feed
From: cgel.zte@gmail.com
To: krzysztof.kozlowski@linaro.org, davem@davemloft.net
Cc: kuba@kernel.org, lv.ruyi@zte.com.cn, yashsri421@gmail.com,
	sameo@linux.intel.com, cuissard@marvell.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Zeal Robot <zealci@zte.com.cn>
Subject: [PATCH] NFC: nfcmrvl: fix error check return value of irq_of_parse_and_map()
Date: Fri, 22 Apr 2022 08:46:05 +0000	[thread overview]
Message-ID: <20220422084605.2775542-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: 	b5b3e23e4cac ("NFC: nfcmrvl: add i2c driver")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
 drivers/nfc/nfcmrvl/i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/nfcmrvl/i2c.c b/drivers/nfc/nfcmrvl/i2c.c
index ceef81d93ac9..7dcc97707363 100644
--- a/drivers/nfc/nfcmrvl/i2c.c
+++ b/drivers/nfc/nfcmrvl/i2c.c
@@ -167,7 +167,7 @@ static int nfcmrvl_i2c_parse_dt(struct device_node *node,
 		pdata->irq_polarity = IRQF_TRIGGER_RISING;
 
 	ret = irq_of_parse_and_map(node, 0);
-	if (ret < 0) {
+	if (!ret) {
 		pr_err("Unable to get irq, error: %d\n", ret);
 		return ret;
 	}
-- 
2.25.1



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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22  8:46 cgel.zte [this message]
2022-04-22 10:30 ` [PATCH] NFC: nfcmrvl: fix error check return value of irq_of_parse_and_map() Krzysztof Kozlowski
2022-04-22 23:09 ` Jakub Kicinski
2022-04-24  2:57   ` [PATCH v2] " cgel.zte
2022-04-24 10:46     ` Krzysztof Kozlowski

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=20220422084605.2775542-1-lv.ruyi@zte.com.cn \
    --to=cgel.zte@gmail.com \
    --cc=cuissard@marvell.com \
    --cc=davem@davemloft.net \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lv.ruyi@zte.com.cn \
    --cc=netdev@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=yashsri421@gmail.com \
    --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.