Skip to content

Commit

Permalink
nfc: nfcmrvl: Fix irq_of_parse_and_map() return value
Browse files Browse the repository at this point in the history
commit 5a478a6 upstream.

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

Reported-by: Lv Ruyi <lv.ruyi@zte.com.cn>
Fixes: caf6e49 ("NFC: nfcmrvl: add spi driver")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220627124048.296253-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
krzk authored and gregkh committed Jul 7, 2022
1 parent 63b2fe5 commit 7d36336
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions drivers/nfc/nfcmrvl/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,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;

Expand Down
6 changes: 3 additions & 3 deletions drivers/nfc/nfcmrvl/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,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;

Expand Down

0 comments on commit 7d36336

Please sign in to comment.