Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5a478a6

Browse files
krzkkuba-moo
authored andcommitted
nfc: nfcmrvl: Fix irq_of_parse_and_map() return value
The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO. Reported-by: Lv Ruyi <[email protected]> Fixes: caf6e49 ("NFC: nfcmrvl: add spi driver") Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 53ad461 commit 5a478a6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

drivers/nfc/nfcmrvl/i2c.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ static int nfcmrvl_i2c_parse_dt(struct device_node *node,
167167
pdata->irq_polarity = IRQF_TRIGGER_RISING;
168168

169169
ret = irq_of_parse_and_map(node, 0);
170-
if (ret < 0) {
171-
pr_err("Unable to get irq, error: %d\n", ret);
172-
return ret;
170+
if (!ret) {
171+
pr_err("Unable to get irq\n");
172+
return -EINVAL;
173173
}
174174
pdata->irq = ret;
175175

drivers/nfc/nfcmrvl/spi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ static int nfcmrvl_spi_parse_dt(struct device_node *node,
115115
}
116116

117117
ret = irq_of_parse_and_map(node, 0);
118-
if (ret < 0) {
119-
pr_err("Unable to get irq, error: %d\n", ret);
120-
return ret;
118+
if (!ret) {
119+
pr_err("Unable to get irq\n");
120+
return -EINVAL;
121121
}
122122
pdata->irq = ret;
123123

0 commit comments

Comments
 (0)