The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2] nfc: nfcmrvl: Fix irq_of_parse_and_map() return value
@ 2022-06-27 12:40 Krzysztof Kozlowski
  2022-06-29  4:40 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-27 12:40 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Samuel Ortiz, Vincent Cuissard, netdev,
	linux-kernel
  Cc: Lv Ruyi

The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO.

Reported-by: Lv Ruyi <lv.ruyi@zte.com.cn>
Fixes: caf6e49bf6d0 ("NFC: nfcmrvl: add spi driver")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Changes since v1:
1. Do not print 'rc' in error msg.
2. Fix also I2C.
---
 drivers/nfc/nfcmrvl/i2c.c | 6 +++---
 drivers/nfc/nfcmrvl/spi.c | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/nfc/nfcmrvl/i2c.c b/drivers/nfc/nfcmrvl/i2c.c
index ceef81d93ac9..01329b91d59d 100644
--- a/drivers/nfc/nfcmrvl/i2c.c
+++ b/drivers/nfc/nfcmrvl/i2c.c
@@ -167,9 +167,9 @@ 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) {
-		pr_err("Unable to get irq, error: %d\n", ret);
-		return ret;
+	if (!ret) {
+		pr_err("Unable to get irq\n");
+		return -EINVAL;
 	}
 	pdata->irq = ret;
 
diff --git a/drivers/nfc/nfcmrvl/spi.c b/drivers/nfc/nfcmrvl/spi.c
index a38e2fcdfd39..ad3359a4942c 100644
--- a/drivers/nfc/nfcmrvl/spi.c
+++ b/drivers/nfc/nfcmrvl/spi.c
@@ -115,9 +115,9 @@ static int nfcmrvl_spi_parse_dt(struct device_node *node,
 	}
 
 	ret = irq_of_parse_and_map(node, 0);
-	if (ret < 0) {
-		pr_err("Unable to get irq, error: %d\n", ret);
-		return ret;
+	if (!ret) {
+		pr_err("Unable to get irq\n");
+		return -EINVAL;
 	}
 	pdata->irq = ret;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] nfc: nfcmrvl: Fix irq_of_parse_and_map() return value
  2022-06-27 12:40 [PATCH v2] nfc: nfcmrvl: Fix irq_of_parse_and_map() return value Krzysztof Kozlowski
@ 2022-06-29  4:40 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-06-29  4:40 UTC (permalink / raw)
  To: Krzysztof Kozlowski; +Cc: sameo, cuissard, netdev, linux-kernel, lv.ruyi

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 27 Jun 2022 14:40:48 +0200 you wrote:
> The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO.
> 
> Reported-by: Lv Ruyi <lv.ruyi@zte.com.cn>
> Fixes: caf6e49bf6d0 ("NFC: nfcmrvl: add spi driver")
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> 
> [...]

Here is the summary with links:
  - [v2] nfc: nfcmrvl: Fix irq_of_parse_and_map() return value
    https://git.kernel.org/netdev/net/c/5a478a653b4c

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-29  4:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-27 12:40 [PATCH v2] nfc: nfcmrvl: Fix irq_of_parse_and_map() return value Krzysztof Kozlowski
2022-06-29  4:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox