diff mbox series

rpmsg: qcom_smd: fix error code if irq_of_parse_and_map()

Message ID YmpgTNlE/niOL8E6@kili (mailing list archive)
State Superseded
Headers show
Series rpmsg: qcom_smd: fix error code if irq_of_parse_and_map() | expand

Commit Message

Dan Carpenter April 28, 2022, 9:37 a.m. UTC
The irq_of_parse_and_map() returns zero on failure but we want to return
a negative error code.

Fixes: 1a358d350664 ("rpmsg: qcom_smd: Fix irq_of_parse_and_map() return value")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/rpmsg/qcom_smd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Krzysztof Kozlowski April 28, 2022, 9:46 a.m. UTC | #1
On 28/04/2022 11:37, Dan Carpenter wrote:
> The irq_of_parse_and_map() returns zero on failure but we want to return
> a negative error code.
> 
> Fixes: 1a358d350664 ("rpmsg: qcom_smd: Fix irq_of_parse_and_map() return value")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks, I already sent a fix for this:
https://lore.kernel.org/all/20220423093932.32136-1-krzysztof.kozlowski@linaro.org/


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
index 6ccfa12abd10..1957b27c4cf3 100644
--- a/drivers/rpmsg/qcom_smd.c
+++ b/drivers/rpmsg/qcom_smd.c
@@ -1409,7 +1409,7 @@  static int qcom_smd_parse_edge(struct device *dev,
 	irq = irq_of_parse_and_map(node, 0);
 	if (!irq) {
 		dev_err(dev, "required smd interrupt missing\n");
-		ret = irq;
+		ret = -EINVAL;
 		goto put_node;
 	}