linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] gpiolib: Remove unused of_mm_gpiochip_add()
@ 2023-01-12 14:45 Andy Shevchenko
  2023-01-13 12:45 ` Bartosz Golaszewski
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Andy Shevchenko @ 2023-01-12 14:45 UTC (permalink / raw)
  To: Andy Shevchenko, Marc Zyngier, Bartosz Golaszewski,
	Dmitry Torokhov, linux-gpio, linux-kernel, devicetree
  Cc: Linus Walleij, Bartosz Golaszewski, Rob Herring, Frank Rowand

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

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/TODO       | 4 ++--
 include/linux/of_gpio.h | 5 -----
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/gpio/TODO b/drivers/gpio/TODO
index 76560744587a..68ada1066941 100644
--- a/drivers/gpio/TODO
+++ b/drivers/gpio/TODO
@@ -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
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
index e27a9187c0c6..935225caf70d 100644
--- a/include/linux/of_gpio.h
+++ b/include/linux/of_gpio.h
@@ -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 */
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 1/1] gpiolib: Remove unused of_mm_gpiochip_add()
  2023-01-12 14:45 [PATCH v1 1/1] gpiolib: Remove unused of_mm_gpiochip_add() Andy Shevchenko
@ 2023-01-13 12:45 ` Bartosz Golaszewski
  2023-01-13 20:28 ` Rob Herring
  2023-01-16 14:17 ` Linus Walleij
  2 siblings, 0 replies; 6+ messages in thread
From: Bartosz Golaszewski @ 2023-01-13 12:45 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Bartosz Golaszewski, Dmitry Torokhov, linux-gpio,
	linux-kernel, devicetree, Linus Walleij, Rob Herring,
	Frank Rowand

On Thu, Jan 12, 2023 at 4:18 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> of_mm_gpiochip_add() is unused API, remove it for good.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/gpio/TODO       | 4 ++--
>  include/linux/of_gpio.h | 5 -----
>  2 files changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpio/TODO b/drivers/gpio/TODO
> index 76560744587a..68ada1066941 100644
> --- a/drivers/gpio/TODO
> +++ b/drivers/gpio/TODO
> @@ -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
> diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
> index e27a9187c0c6..935225caf70d 100644
> --- a/include/linux/of_gpio.h
> +++ b/include/linux/of_gpio.h
> @@ -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 */
> --
> 2.39.0
>

Applied, thanks!

Bart

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 1/1] gpiolib: Remove unused of_mm_gpiochip_add()
  2023-01-12 14:45 [PATCH v1 1/1] gpiolib: Remove unused of_mm_gpiochip_add() Andy Shevchenko
  2023-01-13 12:45 ` Bartosz Golaszewski
@ 2023-01-13 20:28 ` Rob Herring
  2023-01-13 21:18   ` Andy Shevchenko
  2023-01-16 14:17 ` Linus Walleij
  2 siblings, 1 reply; 6+ messages in thread
From: Rob Herring @ 2023-01-13 20:28 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Bartosz Golaszewski, Dmitry Torokhov, linux-gpio,
	linux-kernel, devicetree, Linus Walleij, Bartosz Golaszewski,
	Frank Rowand

On Thu, Jan 12, 2023 at 04:45:26PM +0200, Andy Shevchenko wrote:
> of_mm_gpiochip_add() is unused API, remove it for good.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/gpio/TODO       | 4 ++--
>  include/linux/of_gpio.h | 5 -----
>  2 files changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpio/TODO b/drivers/gpio/TODO
> index 76560744587a..68ada1066941 100644
> --- a/drivers/gpio/TODO
> +++ b/drivers/gpio/TODO
> @@ -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
> diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
> index e27a9187c0c6..935225caf70d 100644
> --- a/include/linux/of_gpio.h
> +++ b/include/linux/of_gpio.h
> @@ -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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 1/1] gpiolib: Remove unused of_mm_gpiochip_add()
  2023-01-13 20:28 ` Rob Herring
@ 2023-01-13 21:18   ` Andy Shevchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2023-01-13 21:18 UTC (permalink / raw)
  To: Rob Herring
  Cc: Marc Zyngier, Bartosz Golaszewski, Dmitry Torokhov, linux-gpio,
	linux-kernel, devicetree, Linus Walleij, Bartosz Golaszewski,
	Frank Rowand

On Fri, Jan 13, 2023 at 02:28:26PM -0600, Rob Herring wrote:
> On Thu, Jan 12, 2023 at 04:45:26PM +0200, Andy Shevchenko wrote:
> > of_mm_gpiochip_add() is unused API, remove it for good.

...

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

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 1/1] gpiolib: Remove unused of_mm_gpiochip_add()
  2023-01-12 14:45 [PATCH v1 1/1] gpiolib: Remove unused of_mm_gpiochip_add() Andy Shevchenko
  2023-01-13 12:45 ` Bartosz Golaszewski
  2023-01-13 20:28 ` Rob Herring
@ 2023-01-16 14:17 ` Linus Walleij
  2023-01-16 14:44   ` Andy Shevchenko
  2 siblings, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2023-01-16 14:17 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Bartosz Golaszewski, Dmitry Torokhov, linux-gpio,
	linux-kernel, devicetree, Bartosz Golaszewski, Rob Herring,
	Frank Rowand

On Thu, Jan 12, 2023 at 4:18 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> of_mm_gpiochip_add() is unused API, remove it for good.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 1/1] gpiolib: Remove unused of_mm_gpiochip_add()
  2023-01-16 14:17 ` Linus Walleij
@ 2023-01-16 14:44   ` Andy Shevchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2023-01-16 14:44 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Marc Zyngier, Bartosz Golaszewski, Dmitry Torokhov, linux-gpio,
	linux-kernel, devicetree, Bartosz Golaszewski, Rob Herring,
	Frank Rowand

On Mon, Jan 16, 2023 at 03:17:29PM +0100, Linus Walleij wrote:
> On Thu, Jan 12, 2023 at 4:18 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> 
> > of_mm_gpiochip_add() is unused API, remove it for good.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> 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.

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

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-01-16 14:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-12 14:45 [PATCH v1 1/1] gpiolib: Remove unused of_mm_gpiochip_add() Andy Shevchenko
2023-01-13 12:45 ` Bartosz Golaszewski
2023-01-13 20:28 ` Rob Herring
2023-01-13 21:18   ` Andy Shevchenko
2023-01-16 14:17 ` Linus Walleij
2023-01-16 14:44   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).