diff mbox series

[2/2] pinctrl: ocelot: Fix interrupt parsing

Message ID 20220303203716.3012703-3-horatiu.vultur@microchip.com
State New
Headers show
Series pinctrl: ocelot: Add fixes for ocelot driver | expand

Commit Message

Horatiu Vultur March 3, 2022, 8:37 p.m. UTC
In the blamed commit, it removes the duplicate of_node assignment in the
driver. But the driver uses this before calling into of_gpio_dev_init to
determine if it needs to assign an IRQ chip to the GPIO. The fixes
consists in using of_node from dev.

Fixes: 8a8d6bbe1d3bc7 ("pinctrl: Get rid of duplicate of_node assignment in the drivers")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 drivers/pinctrl/pinctrl-ocelot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Shevchenko March 4, 2022, 12:40 p.m. UTC | #1
On Thu, Mar 03, 2022 at 09:37:16PM +0100, Horatiu Vultur wrote:
> In the blamed commit, it removes the duplicate of_node assignment in the
> driver. But the driver uses this before calling into of_gpio_dev_init to
> determine if it needs to assign an IRQ chip to the GPIO. The fixes
> consists in using of_node from dev.

...

> -	irq = irq_of_parse_and_map(gc->of_node, 0);
> +	irq = irq_of_parse_and_map(info->dev->of_node, 0);

Why platform_get_irq() can't be used?
Andy Shevchenko March 4, 2022, 12:41 p.m. UTC | #2
On Fri, Mar 04, 2022 at 02:40:38PM +0200, Andy Shevchenko wrote:
> On Thu, Mar 03, 2022 at 09:37:16PM +0100, Horatiu Vultur wrote:
> > In the blamed commit, it removes the duplicate of_node assignment in the
> > driver. But the driver uses this before calling into of_gpio_dev_init to
> > determine if it needs to assign an IRQ chip to the GPIO. The fixes
> > consists in using of_node from dev.
> 
> ...
> 
> > -	irq = irq_of_parse_and_map(gc->of_node, 0);
> > +	irq = irq_of_parse_and_map(info->dev->of_node, 0);
> 
> Why platform_get_irq() can't be used?

Or actually _optional() variant of it?
Horatiu Vultur March 4, 2022, 2:26 p.m. UTC | #3
The 03/04/2022 14:41, Andy Shevchenko wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On Fri, Mar 04, 2022 at 02:40:38PM +0200, Andy Shevchenko wrote:
> > On Thu, Mar 03, 2022 at 09:37:16PM +0100, Horatiu Vultur wrote:
> > > In the blamed commit, it removes the duplicate of_node assignment in the
> > > driver. But the driver uses this before calling into of_gpio_dev_init to
> > > determine if it needs to assign an IRQ chip to the GPIO. The fixes
> > > consists in using of_node from dev.
> >
> > ...
> >
> > > -   irq = irq_of_parse_and_map(gc->of_node, 0);
> > > +   irq = irq_of_parse_and_map(info->dev->of_node, 0);
> >
> > Why platform_get_irq() can't be used?
> 
> Or actually _optional() variant of it?

It can be used. I will update this in the next series.

> 
> --
> With Best Regards,
> Andy Shevchenko
> 
>
diff mbox series

Patch

diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c
index a859fbcb09af..a0f00380e700 100644
--- a/drivers/pinctrl/pinctrl-ocelot.c
+++ b/drivers/pinctrl/pinctrl-ocelot.c
@@ -1851,7 +1851,7 @@  static int ocelot_gpiochip_register(struct platform_device *pdev,
 	gc->base = -1;
 	gc->label = "ocelot-gpio";
 
-	irq = irq_of_parse_and_map(gc->of_node, 0);
+	irq = irq_of_parse_and_map(info->dev->of_node, 0);
 	if (irq) {
 		girq = &gc->irq;
 		girq->chip = &ocelot_irqchip;