mbox series

[v3,0/7] gpio: ep93xx: fixes series patch

Message ID 20210128122123.25341-1-nikita.shubin@maquefel.me
Headers show
Series gpio: ep93xx: fixes series patch | expand

Message

Nikita Shubin Jan. 28, 2021, 12:21 p.m. UTC
v2: 
https://lore.kernel.org/linux-gpio/20210127104617.1173-1-nikita.shubin@maquefel.me/

v2->v3 changes

[PATCH v3 1/7] gpio: ep93xx: fix BUG_ON port F usage
As suggested Andy Shevchenko dropped  most of commit message

[PATCH v3 2/7] gpio: ep93xx: Fix single irqchip with multi
 gpiochips
- Andy Shevchenko:
	- added coma
- Alexander Sverdlin:
	- changed to fixes commit d2b091961510

[PATCH v2 6/9] gpio: ep93xx: refactor ep93xx_gpio_add_bank
- Alexander Sverdlin:
	- use ->num_parents instead of ARRAY_SIZE()

Alexander - i think you are right about these two patches
they have no meaning currently, so i dropped them.

[PATCH v2 7/9] gpio: ep93xx: separate IRQ's setup
- Alexander Sverdlin:
	- drop patch entirely

[PATCH v2 9/9] gpio: ep93xx: replace bools with idx for IRQ ports
- Alexander Sverdlin:
	- drop patch entirely

Comments

Andy Shevchenko Jan. 28, 2021, 4:15 p.m. UTC | #1
On Thu, Jan 28, 2021 at 2:21 PM Nikita Shubin <nikita.shubin@maquefel.me> wrote:
>
> v2:
> https://lore.kernel.org/linux-gpio/20210127104617.1173-1-nikita.shubin@maquefel.me/
>
> v2->v3 changes

I stopped reviewing at some point, b/c I have a feeling that I gave
you tags (and others) against some patches and none of them has any.
Am I missing something?
Alexander Sverdlin Jan. 28, 2021, 6:35 p.m. UTC | #2
Hi!

On Thu, 2021-01-28 at 15:21 +0300, Nikita Shubin wrote:
> Port F irq's should be statically mapped to EP93XX_GPIO_F_IRQ_BASE.
> 
> So we need to specify girq->first otherwise:
> 
> "If device tree is used, then first_irq will be 0 and
> irqs get mapped dynamically on the fly"
> 
> And that's not the thing we want.
> 
> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>

Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> ---
>  drivers/gpio/gpio-ep93xx.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c
> index b990d37da143..dc88115e34da 100644
> --- a/drivers/gpio/gpio-ep93xx.c
> +++ b/drivers/gpio/gpio-ep93xx.c
> @@ -430,6 +430,7 @@ static int ep93xx_gpio_add_bank(struct gpio_chip
> *gc,
>                 girq->default_type = IRQ_TYPE_NONE;
>                 girq->handler = handle_level_irq;
>                 gc->to_irq = ep93xx_gpio_f_to_irq;
> +               girq->first = EP93XX_GPIO_F_IRQ_BASE;
>         }
>  
>         return devm_gpiochip_add_data(dev, gc, epg);
Alexander Sverdlin Jan. 28, 2021, 6:38 p.m. UTC | #3
On Thu, 2021-01-28 at 15:21 +0300, Nikita Shubin wrote:
> - replace plain numbers with girq->num_parents in devm_kcalloc
> - replace plain numbers with girq->num_parents for port F
> - refactor i - 1 to i + 1 to make loop more readable
> - combine getting IRQ's loop and setting handler's into single loop
> 
> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>

Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> ---
> v2->v3
> - use ->num_parents instead of ARRAY_SIZE()
> ---
>  drivers/gpio/gpio-ep93xx.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c
> index d69ec09cd618..df55aa13bd9a 100644
> --- a/drivers/gpio/gpio-ep93xx.c
> +++ b/drivers/gpio/gpio-ep93xx.c
> @@ -384,7 +384,7 @@ static int ep93xx_gpio_add_bank(struct gpio_chip
> *gc,
>  
>                 girq->parent_handler = ep93xx_gpio_ab_irq_handler;
>                 girq->num_parents = 1;
> -               girq->parents = devm_kcalloc(dev, 1,
> +               girq->parents = devm_kcalloc(dev, girq->num_parents,
>                                              sizeof(*girq->parents),
>                                              GFP_KERNEL);
>                 if (!girq->parents)
> @@ -406,15 +406,14 @@ static int ep93xx_gpio_add_bank(struct
> gpio_chip *gc,
>                  */
>                 girq->parent_handler = ep93xx_gpio_f_irq_handler;
>                 girq->num_parents = 8;
> -               girq->parents = devm_kcalloc(dev, 8,
> +               girq->parents = devm_kcalloc(dev, girq->num_parents,
>                                              sizeof(*girq->parents),
>                                              GFP_KERNEL);
>                 if (!girq->parents)
>                         return -ENOMEM;
>                 /* Pick resources 1..8 for these IRQs */
> -               for (i = 1; i <= 8; i++)
> -                       girq->parents[i - 1] = platform_get_irq(pdev,
> i);
> -               for (i = 0; i < 8; i++) {
> +               for (i = 0; i < girq->num_parents; i++) {
> +                       girq->parents[i] = platform_get_irq(pdev, i +
> 1);
>                         gpio_irq = EP93XX_GPIO_F_IRQ_BASE + i;
>                         irq_set_chip_data(gpio_irq, &epg->gc[5]);
>                         irq_set_chip_and_handler(gpio_irq,
Linus Walleij Feb. 2, 2021, 7:24 p.m. UTC | #4
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>


For the entire series.

Yours,
Linus Walleij