Re: [PATCH v2 1/1] gpio: vf610: make irq_chip immutable

From: Andy Shevchenko
Date: Tue Feb 14 2023 - 11:48:59 EST


On Tue, Feb 14, 2023 at 6:45 PM Andy Shevchenko
<andy.shevchenko@xxxxxxxxx> wrote:
> On Tue, Feb 14, 2023 at 2:59 PM Alexander Stein
> <alexander.stein@xxxxxxxxxxxxxxx> wrote:

...

> > void __iomem *pcr_base = port->base + PORT_PCR(d->hwirq);
>
> Now you can use gpio_num here...
>
> > + irq_hw_number_t gpio_num = irqd_to_hwirq(d);

...

> > static void vf610_gpio_irq_unmask(struct irq_data *d)
> > {
> > - struct vf610_gpio_port *port =
> > - gpiochip_get_data(irq_data_get_irq_chip_data(d));
> > + struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
> > + struct vf610_gpio_port *port = gpiochip_get_data(gc);
> > void __iomem *pcr_base = port->base + PORT_PCR(d->hwirq);

And here.

> > + irq_hw_number_t gpio_num = irqd_to_hwirq(d);
> >
> > + gpiochip_enable_irq(gc, gpio_num);
> > vf610_gpio_writel(port->irqc[d->hwirq] << PORT_PCR_IRQC_OFFSET,
>
> ...and here.
>
> > pcr_base);
> > }

--
With Best Regards,
Andy Shevchenko