Skip to contentSkip to conversation

gpio: drop broken to_gpio_irq_chip() helper

PATCH In review Johan Hovold 3 participants 3 messages Nov 12, 2018 – Nov 16, 2018 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: drop broken to_gpio_irq_chip() helper

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 <[email protected]>
Cc Grygorii Strashko <[email protected]>
---
 include/linux/gpio/driver.h | 5 -----
 1 file changed, 5 deletions(-)
include/linux/gpio/driver.h +0 -5
index 2db62b550b95..21bff1f14fde 100644
@@ -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
 
 /**
Signature · 1 line
2.19.1
Reviewed-by on v1 1/1
#1 lore raw

pon., 12 lis 2018 o 15:11 Johan Hovold <[email protected]> napisał(a):

Quoted 4 lines

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...

Quoted 28 lines

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 <[email protected]>
Cc Grygorii Strashko <[email protected]>
---
 include/linux/gpio/driver.h | 5 -----
 1 file changed, 5 deletions(-)
include/linux/gpio/driver.h +0 -6
index 2db62b550b95..21bff1f14fde 100644
@@ -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
 
 /**
--
Quoted 2 lines

2.19.1

#2 lore raw
In reply to Johan Hovold
Quoted 10 lines · Johan Hovold

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 <[email protected]>
Cc Grygorii Strashko <[email protected]>

Patch applied, thanks!

Yours,
Linus Walleij