@@ -115,11 +115,6 @@ struct gpio_array {
unsigned long invert_mask[];
};
-#define for_each_gpio_desc(gc, desc) \
- for (unsigned int __i = 0; \
- __i < gc->ngpio && (desc = gpiochip_get_desc(gc, __i)); \
- __i++) \
-
#define for_each_gpio_desc_with_flag(gc, desc, flag) \
for_each_gpio_desc(gc, desc) \
if (!test_bit(flag, &desc->flags)) {} else
@@ -813,6 +813,11 @@ const char *gpio_device_get_label(struct gpio_device *gdev);
struct gpio_device *gpio_device_find_by_label(const char *label);
struct gpio_device *gpio_device_find_by_fwnode(const struct fwnode_handle *fwnode);
+#define for_each_gpio_desc(gc, desc) \
+ for (unsigned int __i = 0; \
+ __i < gc->ngpio && (desc = gpiochip_get_desc(gc, __i)); \
+ __i++) \
+
#else /* CONFIG_GPIOLIB */
#include <asm/bug.h>
The for_each_gpio_desc() iterator is a convenient helper and is also useful for GPIO controller drivers. Move this helper from the internal gpiolib.h to driver.h. Signed-off-by: Kevin Hilman <khilman@baylibre.com> --- drivers/gpio/gpiolib.h | 5 ----- include/linux/gpio/driver.h | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-)