* [PATCH 1/2] of: irq: use of_property_read_bool() for "interrupt-controller" prop
@ 2017-07-08 20:29 Sergei Shtylyov
[not found] ` <20170708203318.045262932-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2017-07-08 20:29 UTC (permalink / raw)
To: Rob Herring, Frank Rowand, devicetree-u79uwXL29TY76Z2rM5mHXA
Cc: Sergei Shtylyov
[-- Attachment #1: of-irq-use-of_property_read_bool-for-interrupt-controller-prop.patch --]
[-- Type: text/plain, Size: 1546 bytes --]
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.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
---
drivers/of/irq.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
Index: linux/drivers/of/irq.c
===================================================================
--- linux.orig/drivers/of/irq.c
+++ 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread[parent not found: <20170708203318.045262932-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>]
* Re: [PATCH 1/2] of: irq: use of_property_read_bool() for "interrupt-controller" prop [not found] ` <20170708203318.045262932-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org> @ 2017-07-21 15:46 ` Rob Herring 2017-07-21 17:36 ` Sergei Shtylyov 0 siblings, 1 reply; 3+ messages in thread From: Rob Herring @ 2017-07-21 15:46 UTC (permalink / raw) To: Sergei Shtylyov; +Cc: Frank Rowand, devicetree-u79uwXL29TY76Z2rM5mHXA On Sat, Jul 08, 2017 at 11:29:51PM +0300, Sergei Shtylyov wrote: > 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. > > Signed-off-by: Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org> > > --- > 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] of: irq: use of_property_read_bool() for "interrupt-controller" prop 2017-07-21 15:46 ` Rob Herring @ 2017-07-21 17:36 ` Sergei Shtylyov 0 siblings, 0 replies; 3+ messages in thread From: Sergei Shtylyov @ 2017-07-21 17:36 UTC (permalink / raw) To: Rob Herring; +Cc: Frank Rowand, devicetree-u79uwXL29TY76Z2rM5mHXA On 07/21/2017 06:46 PM, Rob Herring wrote: >> 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. >> >> Signed-off-by: Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org> >> >> --- >> drivers/of/irq.c | 5 ++--- >> 1 file changed, 2 insertions(+), 3 deletions(-) > > Both applied, thanks. TY! > Any plans to convert other users? No, not yet -- I fix things as I see them. > Rob MBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-21 17:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-08 20:29 [PATCH 1/2] of: irq: use of_property_read_bool() for "interrupt-controller" prop Sergei Shtylyov
[not found] ` <20170708203318.045262932-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2017-07-21 15:46 ` Rob Herring
2017-07-21 17:36 ` Sergei Shtylyov
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.