diff mbox series

of: irq: Fix the return value for of_irq_parse_one() stub

Message ID 20210210200050.4106032-1-saravanak@google.com
State Not Applicable, archived
Headers show
Series of: irq: Fix the return value for of_irq_parse_one() stub | expand

Checks

Context Check Description
robh/checkpatch warning total: 0 errors, 2 warnings, 8 lines checked

Commit Message

Saravana Kannan Feb. 10, 2021, 8 p.m. UTC
When commit 1852ebd13542 ("of: irq: make a stub for of_irq_parse_one()")
added a stub for of_irq_parse_one() it set the return value to 0. Return
value of 0 in this instance means the call succeeded and the out_irq
pointer was filled with valid data. So, fix it to return an error value.

Fixes: 1852ebd13542 ("of: irq: make a stub for of_irq_parse_one()")
Signed-off-by: Saravana Kannan <saravanak@google.com>
---

This needs to go into driver-core.

-Saravana

 include/linux/of_irq.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stephen Rothwell Feb. 10, 2021, 9:09 p.m. UTC | #1
Hi Saravana,

On Wed, 10 Feb 2021 12:00:49 -0800 Saravana Kannan <saravanak@google.com> wrote:
>
> When commit 1852ebd13542 ("of: irq: make a stub for of_irq_parse_one()")
> added a stub for of_irq_parse_one() it set the return value to 0. Return
> value of 0 in this instance means the call succeeded and the out_irq
> pointer was filled with valid data. So, fix it to return an error value.
> 
> Fixes: 1852ebd13542 ("of: irq: make a stub for of_irq_parse_one()")
> Signed-off-by: Saravana Kannan <saravanak@google.com>

Oops, sorry about that.

Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
diff mbox series

Patch

diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
index f898d838d201..aaf219bd0354 100644
--- a/include/linux/of_irq.h
+++ b/include/linux/of_irq.h
@@ -60,7 +60,7 @@  u32 of_msi_map_id(struct device *dev, struct device_node *msi_np, u32 id_in);
 static inline int of_irq_parse_one(struct device_node *device, int index,
 				   struct of_phandle_args *out_irq)
 {
-	return 0;
+	return -EINVAL;
 }
 static inline int of_irq_count(struct device_node *dev)
 {