mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
gpiolib: Introduce for_each_gpiochip_node() loop helper
Introduce for_each_gpiochip_node() loop helper which iterates over the GPIO controller child nodes of a given device. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Bartosz Golaszewski <brgl@bgdev.pl>
This commit is contained in:
parent
0c2cae09a7
commit
85ebb1a6bd
1 changed files with 6 additions and 1 deletions
|
@ -3,13 +3,14 @@
|
|||
#define __LINUX_GPIO_DRIVER_H
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/irqchip/chained_irq.h>
|
||||
#include <linux/irqdomain.h>
|
||||
#include <linux/lockdep.h>
|
||||
#include <linux/pinctrl/pinctrl.h>
|
||||
#include <linux/pinctrl/pinconf-generic.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct gpio_desc;
|
||||
struct of_phandle_args;
|
||||
|
@ -750,4 +751,8 @@ static inline void gpiochip_unlock_as_irq(struct gpio_chip *gc,
|
|||
}
|
||||
#endif /* CONFIG_GPIOLIB */
|
||||
|
||||
#define for_each_gpiochip_node(dev, child) \
|
||||
device_for_each_child_node(dev, child) \
|
||||
if (!fwnode_property_present(child, "gpio-controller")) {} else
|
||||
|
||||
#endif /* __LINUX_GPIO_DRIVER_H */
|
||||
|
|
Loading…
Reference in a new issue