History

nfc: nfcmrvl: Fix irq_of_parse_and_map() return value

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

Krzysztof Kozlowski committed 4 years ago

Commit 5a478a61 parent 53ad4612 files · +6 −6Browse files

Unified · Split

2 files
  1. drivers/nfc/nfcmrvl/i2c.c +3 −3
  2. drivers/nfc/nfcmrvl/spi.c +3 −3
drivers/nfc/nfcmrvl/i2c.c+3−3
@@ -167,9 +167,9 @@ static int nfcmrvl_i2c_parse_dt(struct device_node *node, · 166 unmodified lines
167 pdata->irq_polarity = IRQF_TRIGGER_RISING;167 pdata->irq_polarity = IRQF_TRIGGER_RISING;
168 168
169 ret = irq_of_parse_and_map(node, 0);169 ret = irq_of_parse_and_map(node, 0);
170 if (ret < 0) {170 if (!ret) {
171 pr_err("Unable to get irq, error: %d\n", ret);171 pr_err("Unable to get irq\n");
172 return ret;172 return -EINVAL;
173 }173 }
174 pdata->irq = ret;174 pdata->irq = ret;
175 175
drivers/nfc/nfcmrvl/spi.c+3−3
@@ -115,9 +115,9 @@ static int nfcmrvl_spi_parse_dt(struct device_node *node, · 114 unmodified lines
115 }115 }
116 116
117 ret = irq_of_parse_and_map(node, 0);117 ret = irq_of_parse_and_map(node, 0);
118 if (ret < 0) {118 if (!ret) {
119 pr_err("Unable to get irq, error: %d\n", ret);119 pr_err("Unable to get irq\n");
120 return ret;120 return -EINVAL;
121 }121 }
122 pdata->irq = ret;122 pdata->irq = ret;
123 123