gpiolib: of: Move enum of_gpio_flags to its only user
Subsystems (2)
PATCH 1/1 gpiolib: of: Move enum of_gpio_flags to its only user
GPIO library for OF is the only user for enum of_gpio_flags. Move it there.
--- drivers/gpio/gpiolib-of.c | 15 +++++++++++++++ include/linux/of_gpio.h | 15 --------------- 2 files changed, 15 insertions(+), 15 deletions(-)
drivers/gpio/gpiolib-of.c +15 -0
@@ -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
include/linux/of_gpio.h +0 -15
@@ -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>
Signature · 1 line
2.39.0
Quoted 2 lines · Andy Shevchenko
GPIO library for OF is the only user for enum
of_gpio_flags. Move it there.
...
Quoted 5 lines
+/*
+ * 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.
+ */
Now that I re-read the comment, I think this can be postponed until we get a consensus that no new driver is ever should do non 1:1 mapping.
If that consensus achieved, we may drop this enum altogether and replace it with the generic flags..
Signature · 2 lines
With Best Regards, Andy Shevchenko
Rob Herring
maintainerQuoted 12 lines · Andy Shevchenko
Quoted 2 lines · Andy Shevchenko
GPIO library for OF is the only user for enum
of_gpio_flags. Move it there....
Quoted 5 lines
+/*
+ * 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.
+ */
Quoted 5 lines
Now that I re-read the comment, I think this can be postponed until we get a consensus that no new driver is ever should do non 1:1 mapping.
If that consensus achieved, we may drop this enum altogether and replace it with the generic flags..
We don't keep things with no users. We can move this back if there ever is a user.
Rob
Quoted 4 lines · Rob Herring
Quoted 3 lines · Andy Shevchenko
Quoted 2 lines · Andy Shevchenko
GPIO library for OF is the only user for enum
of_gpio_flags. Move it there.
...
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
+/*
+ * 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.
+ */
Quoted 8 lines
Quoted 5 lines
Now that I re-read the comment, I think this can be postponed until we get a consensus that no new driver is ever should do non 1:1 mapping.
If that consensus achieved, we may drop this enum altogether and replace it with the generic flags..
We don't keep things with no users. We can move this back if there ever is a user.
Yes! But my point to go even deeper and replace this 1:1 mapped bits by the generic ones.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 9 lines · Andy Shevchenko
GPIO library for OF is the only user for enum
of_gpio_flags. Move it there.Signed-off-by Andy Shevchenko <[email protected]>--- drivers/gpio/gpiolib-of.c | 15 +++++++++++++++ include/linux/of_gpio.h | 15 --------------- 2 files changed, 15 insertions(+), 15 deletions(-)
Quoted 4 lines · Andy Shevchenko
GPIO library for OF is the only user for enum
of_gpio_flags. Move it there.Signed-off-by Andy Shevchenko <[email protected]>
I made the same patch independently, but you sent it first, so
Quoted 9 lines · Arnd Bergmann
Quoted 4 lines · Andy Shevchenko
GPIO library for OF is the only user for enum
of_gpio_flags. Move it there.Signed-off-by Andy Shevchenko <[email protected]>I made the same patch independently, but you sent it first, so
Reviewed-by Arnd Bergmann <[email protected]>
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.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 8 lines · Andy Shevchenko
Quoted 6 lines · Arnd Bergmann
Quoted 4 lines · Andy Shevchenko
GPIO library for OF is the only user for enum
of_gpio_flags. Move it there.Signed-off-by Andy Shevchenko <[email protected]>
Quoted 9 lines
Quoted 3 lines
I made the same patch independently, but you sent it first, so
Reviewed-by Arnd Bergmann <[email protected]>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