diff mbox series

[v1,1/1] gpiolib: of: Move enum of_gpio_flags to its only user

Message ID 20230112145140.67573-1-andriy.shevchenko@linux.intel.com
State Accepted
Commit eed5a3bfafe6840494f7752b5cecd2a610b54fef
Headers show
Series [v1,1/1] gpiolib: of: Move enum of_gpio_flags to its only user | expand

Commit Message

Andy Shevchenko Jan. 12, 2023, 2:51 p.m. UTC
GPIO library for OF is the only user for enum of_gpio_flags.
Move it there.

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

Comments

Arnd Bergmann Jan. 26, 2023, 2:46 p.m. UTC | #1
On Thu, Jan 12, 2023, at 15:51, Andy Shevchenko wrote:
> GPIO library for OF is the only user for enum of_gpio_flags.
> Move it there.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

I made the same patch independently, but you sent it first, so

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Andy Shevchenko Jan. 27, 2023, 8:49 a.m. UTC | #2
On Thu, Jan 26, 2023 at 03:46:32PM +0100, Arnd Bergmann wrote:
> On Thu, Jan 12, 2023, at 15:51, Andy Shevchenko wrote:
> > GPIO library for OF is the only user for enum of_gpio_flags.
> > Move it there.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> I made the same patch independently, but you sent it first, so
> 
> Reviewed-by: Arnd Bergmann <arnd@arndb.de>

Thank you!

Bart, I guess we have a consensus to proceed with this, the worries I have
can be addressed later on, i.e. as a followup patch.
Bartosz Golaszewski Jan. 27, 2023, 9:16 a.m. UTC | #3
On Fri, Jan 27, 2023 at 9:49 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Thu, Jan 26, 2023 at 03:46:32PM +0100, Arnd Bergmann wrote:
> > On Thu, Jan 12, 2023, at 15:51, Andy Shevchenko wrote:
> > > GPIO library for OF is the only user for enum of_gpio_flags.
> > > Move it there.
> > >
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >
> > I made the same patch independently, but you sent it first, so
> >
> > Reviewed-by: Arnd Bergmann <arnd@arndb.de>
>
> Thank you!
>
> Bart, I guess we have a consensus to proceed with this, the worries I have
> can be addressed later on, i.e. as a followup patch.
>

Sounds good, applied!

Bart
diff mbox series

Patch

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index edc769d2d338..72d8a3da31e3 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -23,6 +23,21 @@ 
 #include "gpiolib.h"
 #include "gpiolib-of.h"
 
+/*
+ * This is Linux-specific flags. By default controllers' and Linux' mapping
+ * match, but GPIO controllers are free to translate their own flags to
+ * Linux-specific in their .xlate callback. Though, 1:1 mapping is recommended.
+ */
+enum of_gpio_flags {
+	OF_GPIO_ACTIVE_LOW = 0x1,
+	OF_GPIO_SINGLE_ENDED = 0x2,
+	OF_GPIO_OPEN_DRAIN = 0x4,
+	OF_GPIO_TRANSITORY = 0x8,
+	OF_GPIO_PULL_UP = 0x10,
+	OF_GPIO_PULL_DOWN = 0x20,
+	OF_GPIO_PULL_DISABLE = 0x40,
+};
+
 /**
  * of_gpio_named_count() - Count GPIOs for a device
  * @np:		device node to count GPIOs for
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
index 935225caf70d..5d58b3b0a97e 100644
--- a/include/linux/of_gpio.h
+++ b/include/linux/of_gpio.h
@@ -17,21 +17,6 @@ 
 
 struct device_node;
 
-/*
- * This is Linux-specific flags. By default controllers' and Linux' mapping
- * match, but GPIO controllers are free to translate their own flags to
- * Linux-specific in their .xlate callback. Though, 1:1 mapping is recommended.
- */
-enum of_gpio_flags {
-	OF_GPIO_ACTIVE_LOW = 0x1,
-	OF_GPIO_SINGLE_ENDED = 0x2,
-	OF_GPIO_OPEN_DRAIN = 0x4,
-	OF_GPIO_TRANSITORY = 0x8,
-	OF_GPIO_PULL_UP = 0x10,
-	OF_GPIO_PULL_DOWN = 0x20,
-	OF_GPIO_PULL_DISABLE = 0x40,
-};
-
 #ifdef CONFIG_OF_GPIO
 
 #include <linux/container_of.h>