Messages in this thread Patch in this message |  | | From | cgel.zte@gmail ... | Subject | [PATCH v2] NFC: nfcmrvl: fix error check return value of irq_of_parse_and_map() | Date | Sun, 24 Apr 2022 02:57:10 +0000 |
| |
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> --- v2: don't print ret, and return -EINVAL rather than 0 --- drivers/nfc/nfcmrvl/i2c.c | 6 +++--- 1 file changed, 3 insertions(+), 3 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; -- 2.25.1
|  |