diff mbox series

rpmsg: qcom_smd: Fix irq_of_parse_and_map() return value

Message ID 20220422105326.78713-1-krzysztof.kozlowski@linaro.org (mailing list archive)
State Not Applicable
Headers show
Series rpmsg: qcom_smd: Fix irq_of_parse_and_map() return value | expand

Commit Message

Krzysztof Kozlowski April 22, 2022, 10:53 a.m. UTC
The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO.

Fixes: 53e2822e56c7 ("rpmsg: Introduce Qualcomm SMD backend")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/rpmsg/qcom_smd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bjorn Andersson April 23, 2022, 3:46 a.m. UTC | #1
On Fri, 22 Apr 2022 12:53:26 +0200, Krzysztof Kozlowski wrote:
> The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO.
> 
> 

Applied, thanks!

[1/1] rpmsg: qcom_smd: Fix irq_of_parse_and_map() return value
      commit: 1a358d35066487d228a68303d808bc4721c6b1b9

Best regards,
Krzysztof Kozlowski April 23, 2022, 9:30 a.m. UTC | #2
On 23/04/2022 05:46, Bjorn Andersson wrote:
> On Fri, 22 Apr 2022 12:53:26 +0200, Krzysztof Kozlowski wrote:
>> The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO.
>>
>>
> 
> Applied, thanks!
> 
> [1/1] rpmsg: qcom_smd: Fix irq_of_parse_and_map() return value
>       commit: 1a358d35066487d228a68303d808bc4721c6b1b9

Thanks, unfortunately Jakub Kicinski pointed out issue with returning 0
later, which needs a fix. I'll send a fix which can be squashed.


Best regards,
Krzysztof
diff mbox series

Patch

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