nfc: nfcmrvl: Fix irq_of_parse_and_map() return value

commit 5a478a653b4cca148d5c89832f007ec0809d7e6d 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: caf6e49bf6 ("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>
This commit is contained in:
Krzysztof Kozlowski
2022-06-27 14:40:48 +02:00
committed by Greg Kroah-Hartman
parent 89296ac435
commit d13a5b86e2
2 changed files with 6 additions and 6 deletions

View File

@@ -167,9 +167,9 @@ static int nfcmrvl_i2c_parse_dt(struct device_node *node,
pdata->irq_polarity = IRQF_TRIGGER_RISING; pdata->irq_polarity = IRQF_TRIGGER_RISING;
ret = irq_of_parse_and_map(node, 0); ret = irq_of_parse_and_map(node, 0);
if (ret < 0) { if (!ret) {
pr_err("Unable to get irq, error: %d\n", ret); pr_err("Unable to get irq\n");
return ret; return -EINVAL;
} }
pdata->irq = ret; pdata->irq = ret;

View File

@@ -115,9 +115,9 @@ static int nfcmrvl_spi_parse_dt(struct device_node *node,
} }
ret = irq_of_parse_and_map(node, 0); ret = irq_of_parse_and_map(node, 0);
if (ret < 0) { if (!ret) {
pr_err("Unable to get irq, error: %d\n", ret); pr_err("Unable to get irq\n");
return ret; return -EINVAL;
} }
pdata->irq = ret; pdata->irq = ret;