diff mbox series

[RFC,2/3] gpio: ep93xx: drop to_irq binding

Message ID 20201224112203.7174-3-nikita.shubin@maquefel.me
State New
Headers show
Series gpio: ep93xx: convert to multi irqchips | expand

Commit Message

Nikita Shubin Dec. 24, 2020, 11:22 a.m. UTC
As ->to_irq is redefined in gpiochip_add_irqchip, having it defined in
driver is useless, so let's drop it.

Also i think it is worth to give a gentle warning in
gpiochip_add_irqchip, to prevent people relying on to_irq.

For example

WARN_ON_ONCE(gc->to_irq,
"to_irq is redefined in gpiochip_add_irqchip" \
"and you shouldn't rely on it\n");

Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
---
 drivers/gpio/gpio-ep93xx.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

Linus Walleij Dec. 27, 2020, 9:21 p.m. UTC | #1
On Thu, Dec 24, 2020 at 12:22 PM Nikita Shubin
<nikita.shubin@maquefel.me> wrote:

> As ->to_irq is redefined in gpiochip_add_irqchip, having it defined in
> driver is useless, so let's drop it.
>
> Also i think it is worth to give a gentle warning in
> gpiochip_add_irqchip, to prevent people relying on to_irq.
>
> For example
>
> WARN_ON_ONCE(gc->to_irq,
> "to_irq is redefined in gpiochip_add_irqchip" \
> "and you shouldn't rely on it\n");
>
> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Take out the suggestion in the commit message and implement it,
but I think WARN_ON is too nasty, just use dev_err().

Yours,
Linus Walleij
Bartosz Golaszewski Jan. 4, 2021, 2:17 p.m. UTC | #2
On Sun, Dec 27, 2020 at 10:21 PM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Thu, Dec 24, 2020 at 12:22 PM Nikita Shubin
> <nikita.shubin@maquefel.me> wrote:
>
> > As ->to_irq is redefined in gpiochip_add_irqchip, having it defined in
> > driver is useless, so let's drop it.
> >
> > Also i think it is worth to give a gentle warning in
> > gpiochip_add_irqchip, to prevent people relying on to_irq.
> >
> > For example
> >
> > WARN_ON_ONCE(gc->to_irq,
> > "to_irq is redefined in gpiochip_add_irqchip" \
> > "and you shouldn't rely on it\n");
> >
> > Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
> Take out the suggestion in the commit message and implement it,
> but I think WARN_ON is too nasty, just use dev_err().
>
> Yours,
> Linus Walleij

This depends on patch 1/3 so I'll wait until you resend with issues addressed.

Bartosz
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c
index d6db0ff16581..90afe07213ce 100644
--- a/drivers/gpio/gpio-ep93xx.c
+++ b/drivers/gpio/gpio-ep93xx.c
@@ -325,11 +325,6 @@  static int ep93xx_gpio_set_config(struct gpio_chip *gc, unsigned offset,
 	return 0;
 }
 
-static int ep93xx_gpio_f_to_irq(struct gpio_chip *gc, unsigned offset)
-{
-	return EP93XX_GPIO_F_IRQ_BASE + offset;
-}
-
 static int ep93xx_gpio_add_ab_irq_chip(struct gpio_chip *gc,
 					struct platform_device *pdev,
 					struct ep93xx_irq_chip *eic,
@@ -407,7 +402,6 @@  static int ep93xx_gpio_add_f_irq_chip(struct gpio_chip *gc,
 	}
 	girq->default_type = IRQ_TYPE_NONE;
 	girq->handler = handle_level_irq;
-	gc->to_irq = ep93xx_gpio_f_to_irq;
 
 	return 0;
 }