Skip to contentSkip to conversation

gpiolib: Remove unused of_mm_gpiochip_add()

PATCH Applied Andy Shevchenko 4 participants 6 messages Jan 12, 2023 – Jan 16, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpiolib: Remove unused of_mm_gpiochip_add()

of_mm_gpiochip_add() is unused API, remove it for good.

---
 drivers/gpio/TODO       | 4 ++--
 include/linux/of_gpio.h | 5 -----
 2 files changed, 2 insertions(+), 7 deletions(-)
drivers/gpio/TODO +2 -2
index 76560744587a..68ada1066941 100644
@@ -61,8 +61,8 @@ Work items:
 
 - Get rid of struct of_mm_gpio_chip altogether: use the generic  MMIO
   GPIO for all current users (see below). Delete struct of_mm_gpio_chip,
-  to_of_mm_gpio_chip(), of_mm_gpiochip_add_data(), of_mm_gpiochip_add()
-  of_mm_gpiochip_remove() from the kernel.
+  to_of_mm_gpio_chip(), of_mm_gpiochip_add_data(), of_mm_gpiochip_remove()
+  from the kernel.
 
 - Change all consumer drivers that #include <linux/of_gpio.h> to
   #include <linux/gpio/consumer.h> and stop doing custom parsing of the
include/linux/of_gpio.h +0 -5
index e27a9187c0c6..935225caf70d 100644
@@ -56,11 +56,6 @@ extern int of_get_named_gpio(const struct device_node *np,
 extern int of_mm_gpiochip_add_data(struct device_node *np,
 				   struct of_mm_gpio_chip *mm_gc,
 				   void *data);
-static inline int of_mm_gpiochip_add(struct device_node *np,
-				     struct of_mm_gpio_chip *mm_gc)
-{
-	return of_mm_gpiochip_add_data(np, mm_gc, NULL);
-}
 extern void of_mm_gpiochip_remove(struct of_mm_gpio_chip *mm_gc);
 
 #else /* CONFIG_OF_GPIO */
Signature · 1 line
2.39.0
#1 lore raw
Quoted 41 lines · Andy Shevchenko

of_mm_gpiochip_add() is unused API, remove it for good.

---
 drivers/gpio/TODO       | 4 ++--
 include/linux/of_gpio.h | 5 -----
 2 files changed, 2 insertions(+), 7 deletions(-)
drivers/gpio/TODO +2 -2
index 76560744587a..68ada1066941 100644
@@ -61,8 +61,8 @@ Work items:
 
 - Get rid of struct of_mm_gpio_chip altogether: use the generic  MMIO
   GPIO for all current users (see below). Delete struct of_mm_gpio_chip,
-  to_of_mm_gpio_chip(), of_mm_gpiochip_add_data(), of_mm_gpiochip_add()
-  of_mm_gpiochip_remove() from the kernel.
+  to_of_mm_gpio_chip(), of_mm_gpiochip_add_data(), of_mm_gpiochip_remove()
+  from the kernel.
 
 - Change all consumer drivers that #include <linux/of_gpio.h> to
   #include <linux/gpio/consumer.h> and stop doing custom parsing of the
include/linux/of_gpio.h +0 -6
index e27a9187c0c6..935225caf70d 100644
@@ -56,11 +56,6 @@ extern int of_get_named_gpio(const struct device_node *np,
 extern int of_mm_gpiochip_add_data(struct device_node *np,
                                   struct of_mm_gpio_chip *mm_gc,
                                   void *data);
-static inline int of_mm_gpiochip_add(struct device_node *np,
-                                    struct of_mm_gpio_chip *mm_gc)
-{
-       return of_mm_gpiochip_add_data(np, mm_gc, NULL);
-}
 extern void of_mm_gpiochip_remove(struct of_mm_gpio_chip *mm_gc);
 
 #else /* CONFIG_OF_GPIO */
--
Quoted 2 lines

2.39.0

Applied, thanks!

Bart

maintainer
#2 lore raw
In reply to Andy Shevchenko
Quoted 28 lines · Andy Shevchenko

of_mm_gpiochip_add() is unused API, remove it for good.

---
 drivers/gpio/TODO       | 4 ++--
 include/linux/of_gpio.h | 5 -----
 2 files changed, 2 insertions(+), 7 deletions(-)
drivers/gpio/TODO +2 -2
index 76560744587a..68ada1066941 100644
@@ -61,8 +61,8 @@ Work items:
 
 - Get rid of struct of_mm_gpio_chip altogether: use the generic  MMIO
   GPIO for all current users (see below). Delete struct of_mm_gpio_chip,
-  to_of_mm_gpio_chip(), of_mm_gpiochip_add_data(), of_mm_gpiochip_add()
-  of_mm_gpiochip_remove() from the kernel.
+  to_of_mm_gpio_chip(), of_mm_gpiochip_add_data(), of_mm_gpiochip_remove()
+  from the kernel.
 
 - Change all consumer drivers that #include <linux/of_gpio.h> to
   #include <linux/gpio/consumer.h> and stop doing custom parsing of the
include/linux/of_gpio.h +0 -0
index e27a9187c0c6..935225caf70d 100644

include/linux/of_gpio.h extern int of_get_named_gpio(const struct device_node *np, · line 59

Quoted 9 lines
include/linux/of_gpio.h +0 -5
@@ -56,11 +56,6 @@ extern int of_get_named_gpio(const struct device_node *np,
 extern int of_mm_gpiochip_add_data(struct device_node *np,
 				   struct of_mm_gpio_chip *mm_gc,
 				   void *data);
-static inline int of_mm_gpiochip_add(struct device_node *np,
-				     struct of_mm_gpio_chip *mm_gc)
-{
-	return of_mm_gpiochip_add_data(np, mm_gc, NULL);
-}
 extern void of_mm_gpiochip_remove(struct of_mm_gpio_chip *mm_gc);

Keep going!

Looks like of_get_gpio_flags, of_get_gpio, of_gpio_count, of_gpio_named_count, and of_get_named_gpio_flags are all unused.

Rob

#3 lore raw
Quoted 2 lines · Rob Herring
Quoted 1 line · Andy Shevchenko

of_mm_gpiochip_add() is unused API, remove it for good.

...

Quoted 4 lines

Keep going!

Looks like of_get_gpio_flags, of_get_gpio, of_gpio_count, of_gpio_named_count, and of_get_named_gpio_flags are all unused.

Have you checked Linux Next? Everything, but of_gpio_named_count(), which moved to be static, is taken care of by Dmitry Torokhov patches.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#4 lore raw
In reply to Andy Shevchenko
Quoted 3 lines · Andy Shevchenko

of_mm_gpiochip_add() is unused API, remove it for good.

A bit late to the party but THANKS for doing this Andy, it's been a pain for years to have this cruft around.

We even have some traction toward eventual <linux/gpio.h> removal now thanks to Dmitry's efforts, this is great.

Yours,
Linus Walleij

#5 lore raw
Quoted 9 lines · Linus Walleij
Quoted 3 lines · Andy Shevchenko

of_mm_gpiochip_add() is unused API, remove it for good.

A bit late to the party but THANKS for doing this Andy, it's been a pain for years to have this cruft around.

You're welcome! But note, that we still have a few more APIs to remove.

Quoted 2 lines

We even have some traction toward eventual <linux/gpio.h> removal now thanks to Dmitry's efforts, this is great.

I agree, Dmitry did a nice job on this to be happen eventually!

Signature · 2 lines
With Best Regards,
Andy Shevchenko