Skip to contentSkip to conversation

of: irq: use of_property_read_bool() for "interrupt-controller" prop

PATCH In review Sergei Shtylyov 2 participants 3 messages Jul 8, 2017 – Jul 21, 2017 1 message not in the archive Device tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 of: irq: use of_property_read_bool() for "interrupt-controller" prop

The "interrupt-controller" property is boolean, i.e. has no value. The DT interrupt parsing code predates of_property_read_bool(), so it uses either of_get_property() or of_find_property() -- the former isn't quite correct for the boolean props (but works somehow). Use the modern boolean prop API instead.

---
 drivers/of/irq.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/of/irq.c +2 -3
Index: linux/drivers/of/irq.c
===================================================================
@@ -169,8 +169,7 @@ int of_irq_parse_raw(const __be32 *addr,
 		/* Now check if cursor is an interrupt-controller and if it is
 		 * then we are done
 		 */
-		if (of_get_property(ipar, "interrupt-controller", NULL) !=
-				NULL) {
+		if (of_property_read_bool(ipar, "interrupt-controller")) {
 			pr_debug(" -> got it !\n");
 			return 0;
 		}
@@ -508,7 +507,7 @@ void __init of_irq_init(const struct of_
 	INIT_LIST_HEAD(&intc_parent_list);
 
 	for_each_matching_node_and_match(np, matches, &match) {
-		if (!of_find_property(np, "interrupt-controller", NULL) ||
+		if (!of_property_read_bool(np, "interrupt-controller") ||
 				!of_device_is_available(np))
 			continue;
 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
In reply to a message not in the archive
Quoted 11 lines · Sergei Shtylyov

The "interrupt-controller" property is boolean, i.e. has no value. The DT interrupt parsing code predates of_property_read_bool(), so it uses either of_get_property() or of_find_property() -- the former isn't quite correct for the boolean props (but works somehow). Use the modern boolean prop API instead.

---
 drivers/of/irq.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Both applied, thanks.

Any plans to convert other users?

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 6 lines · Rob Herring
Quoted 6 lines

The "interrupt-controller" property is boolean, i.e. has no value. The DT interrupt parsing code predates of_property_read_bool(), so it uses either of_get_property() or of_find_property() -- the former isn't quite correct for the boolean props (but works somehow). Use the modern boolean prop API instead.

Quoted 7 lines
Quoted 5 lines
---
 drivers/of/irq.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Both applied, thanks.

TY!

Quoted 1 line

Any plans to convert other users?

No, not yet -- I fix things as I see them.

Quoted 1 line

Rob

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html