All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] of: irq: fix of_irq_to_resource() error check
@ 2017-07-21 17:30 Sergei Shtylyov
       [not found] ` <20170721173108.578363976-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Sergei Shtylyov @ 2017-07-21 17:30 UTC (permalink / raw)
  To: Rob Herring, Frank Rowand, devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: Thomas Petazzoni, Sergei Shtylyov

[-- Attachment #1: of-irq-fix-of_irq_to_resource-error-check.patch --]
[-- Type: text/plain, Size: 1105 bytes --]

of_irq_to_resource() has recently been fixed to return negative error #'s
along with 0, however of_irq_to_resource_table() still only regards 0 as
invalid IRQ -- fix it up.

Fixes: 7a4228bbff76 ("of: irq: use of_irq_get() in of_irq_to_resource()")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>

---
The patch is against the 'dt/linus' branch of Rob Herring's 'linux.git' repo.

 drivers/of/irq.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux/drivers/of/irq.c
===================================================================
--- linux.orig/drivers/of/irq.c
+++ linux/drivers/of/irq.c
@@ -476,7 +476,7 @@ int of_irq_to_resource_table(struct devi
 	int i;
 
 	for (i = 0; i < nr_irqs; i++, res++)
-		if (!of_irq_to_resource(dev, i, res))
+		if (of_irq_to_resource(dev, i, res) <= 0)
 			break;
 
 	return i;

--
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] 2+ messages in thread

* Re: [PATCH] of: irq: fix of_irq_to_resource() error check
       [not found] ` <20170721173108.578363976-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
@ 2017-07-21 22:07   ` Rob Herring
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2017-07-21 22:07 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Frank Rowand, devicetree-u79uwXL29TY76Z2rM5mHXA, Thomas Petazzoni

On Fri, Jul 21, 2017 at 08:30:39PM +0300, Sergei Shtylyov wrote:
> of_irq_to_resource() has recently been fixed to return negative error #'s
> along with 0, however of_irq_to_resource_table() still only regards 0 as
> invalid IRQ -- fix it up.
> 
> Fixes: 7a4228bbff76 ("of: irq: use of_irq_get() in of_irq_to_resource()")
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
> 
> ---
> The patch is against the 'dt/linus' branch of Rob Herring's 'linux.git' repo.
> 
>  drivers/of/irq.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied.

BTW, all the users of of_irq_to_resource_table outside of the DT 
platform code are erroneous IMO. Either the resources are already 
available when probing or only a single resource is retrieved. These may 
have been working around a problem that some resources couldn't be 
resolved at device creation time which is now fixed.

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] 2+ messages in thread

end of thread, other threads:[~2017-07-21 22:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-21 17:30 [PATCH] of: irq: fix of_irq_to_resource() error check Sergei Shtylyov
     [not found] ` <20170721173108.578363976-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2017-07-21 22:07   ` Rob Herring

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.