The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO.
Unified · Split
| @@ -167,9 +167,9 @@ static int nfcmrvl_i2c_parse_dt(struct device_node *node, · 166 unmodified lines | ||
| 167 | 167 | pdata->irq_polarity = IRQF_TRIGGER_RISING; |
| 168 | 168 | |
| 169 | 169 | 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; | |
| 173 | 173 | } |
| 174 | 174 | pdata->irq = ret; |
| 175 | 175 | |
| @@ -115,9 +115,9 @@ static int nfcmrvl_spi_parse_dt(struct device_node *node, · 114 unmodified lines | ||
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | 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; | |
| 121 | 121 | } |
| 122 | 122 | pdata->irq = ret; |
| 123 | 123 | |