Commit af47d803 authored by Andy Shevchenko's avatar Andy Shevchenko

gpiolib: Introduce a helper to get first GPIO controller node

Introduce a helper to get first GPIO controller node which drivers
may want to use.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
parent 492fca28
......@@ -766,4 +766,14 @@ static inline unsigned int gpiochip_node_count(struct device *dev)
return count;
}
static inline struct fwnode_handle *gpiochip_node_get_first(struct device *dev)
{
struct fwnode_handle *fwnode;
for_each_gpiochip_node(dev, fwnode)
return fwnode;
return NULL;
}
#endif /* __LINUX_GPIO_DRIVER_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment