pinctrl: wpcm450: Switch to use for_each_gpiochip_node() helper
Switch the code to use for_each_gpiochip_node() helper. While at it, correct header inclusion as device property APIs are provided in property.h. Reviewed-by: J. Neuschäfer <j.ne@posteo.net> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/20250220155036.2734838-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
committed by
Linus Walleij
parent
73c2cdfdcf
commit
e2a9df2fe1
@@ -10,7 +10,6 @@
|
||||
// block, shared between all GPIO banks
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/fwnode.h>
|
||||
#include <linux/gpio/driver.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
@@ -18,6 +17,7 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
#include <linux/pinctrl/pinconf.h>
|
||||
@@ -1033,7 +1033,7 @@ static int wpcm450_gpio_register(struct platform_device *pdev,
|
||||
return dev_err_probe(dev, PTR_ERR(pctrl->gpio_base),
|
||||
"Resource fail for GPIO controller\n");
|
||||
|
||||
device_for_each_child_node(dev, child) {
|
||||
for_each_gpiochip_node(dev, child) {
|
||||
void __iomem *dat = NULL;
|
||||
void __iomem *set = NULL;
|
||||
void __iomem *dirout = NULL;
|
||||
@@ -1044,9 +1044,6 @@ static int wpcm450_gpio_register(struct platform_device *pdev,
|
||||
u32 reg;
|
||||
int i;
|
||||
|
||||
if (!fwnode_property_read_bool(child, "gpio-controller"))
|
||||
continue;
|
||||
|
||||
ret = fwnode_property_read_u32(child, "reg", ®);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user