gpio: drop broken to_gpio_irq_chip() helper
diff mbox series

Message ID 20181112141028.10213-1-johan@kernel.org
State New
Headers show
Series
  • gpio: drop broken to_gpio_irq_chip() helper
Related show

Commit Message

Johan Hovold Nov. 12, 2018, 2:10 p.m. UTC
Drop the broken to_gpio_irq_chip() container_of() helper, which would
break the build for anyone who tries to use it.

Specifically, struct gpio_irq_chip only holds a pointer to a struct
irq_chip so using container_of() on an irq-chip pointer makes no sense.

Fixes: da80ff81a8f5 ("gpio: Move irqchip into struct gpio_irq_chip")
Cc: Thierry Reding <treding@nvidia.com>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 include/linux/gpio/driver.h | 5 -----
 1 file changed, 5 deletions(-)

Comments

Bartosz Golaszewski Nov. 12, 2018, 3:48 p.m. UTC | #1
pon., 12 lis 2018 o 15:11 Johan Hovold <johan@kernel.org> napisaƂ(a):
>
> Drop the broken to_gpio_irq_chip() container_of() helper, which would
> break the build for anyone who tries to use it.
>

Which is the usual problem with APIs nobody uses...

> Specifically, struct gpio_irq_chip only holds a pointer to a struct
> irq_chip so using container_of() on an irq-chip pointer makes no sense.
>
> Fixes: da80ff81a8f5 ("gpio: Move irqchip into struct gpio_irq_chip")
> Cc: Thierry Reding <treding@nvidia.com>
> Cc: Grygorii Strashko <grygorii.strashko@ti.com>
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
>  include/linux/gpio/driver.h | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
> index 2db62b550b95..21bff1f14fde 100644
> --- a/include/linux/gpio/driver.h
> +++ b/include/linux/gpio/driver.h
> @@ -166,11 +166,6 @@ struct gpio_irq_chip {
>          */
>         void            (*irq_disable)(struct irq_data *data);
>  };
> -
> -static inline struct gpio_irq_chip *to_gpio_irq_chip(struct irq_chip *chip)
> -{
> -       return container_of(chip, struct gpio_irq_chip, chip);
> -}
>  #endif
>
>  /**
> --
> 2.19.1
>

Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Linus Walleij Nov. 16, 2018, 9:47 p.m. UTC | #2
On Mon, Nov 12, 2018 at 3:11 PM Johan Hovold <johan@kernel.org> wrote:

> Drop the broken to_gpio_irq_chip() container_of() helper, which would
> break the build for anyone who tries to use it.
>
> Specifically, struct gpio_irq_chip only holds a pointer to a struct
> irq_chip so using container_of() on an irq-chip pointer makes no sense.
>
> Fixes: da80ff81a8f5 ("gpio: Move irqchip into struct gpio_irq_chip")
> Cc: Thierry Reding <treding@nvidia.com>
> Cc: Grygorii Strashko <grygorii.strashko@ti.com>
> Signed-off-by: Johan Hovold <johan@kernel.org>

Patch applied, thanks!

Yours,
Linus Walleij

Patch
diff mbox series

diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 2db62b550b95..21bff1f14fde 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -166,11 +166,6 @@  struct gpio_irq_chip {
 	 */
 	void		(*irq_disable)(struct irq_data *data);
 };
-
-static inline struct gpio_irq_chip *to_gpio_irq_chip(struct irq_chip *chip)
-{
-	return container_of(chip, struct gpio_irq_chip, chip);
-}
 #endif
 
 /**