提交 6e106804 编写于 作者: K Krzysztof Kozlowski 提交者: Zheng Zengkai

nfc: nfcmrvl: Fix irq_of_parse_and_map() return value

stable inclusion
from stable-v5.10.129
commit 7d363362e006d67e3d086d1b46a23cda15c7dc66
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5YNDQ

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7d363362e006d67e3d086d1b46a23cda15c7dc66

--------------------------------

commit 5a478a65 upstream.

The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO.
Reported-by: NLv Ruyi <lv.ruyi@zte.com.cn>
Fixes: caf6e49b ("NFC: nfcmrvl: add spi driver")
Signed-off-by: NKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220627124048.296253-1-krzysztof.kozlowski@linaro.orgSigned-off-by: NJakub Kicinski <kuba@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 7b2e5e5c
...@@ -186,9 +186,9 @@ static int nfcmrvl_i2c_parse_dt(struct device_node *node, ...@@ -186,9 +186,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;
......
...@@ -129,9 +129,9 @@ static int nfcmrvl_spi_parse_dt(struct device_node *node, ...@@ -129,9 +129,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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册