diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2022-04-01 13:35:57 +0300 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2022-04-08 18:41:04 +0300 |
commit | 1e0afd470e26f83c674ff239dd5b5347cdc24fdb (patch) | |
tree | c3fe18db81537875cd1faed33cf09a276cd46724 /drivers/pinctrl/renesas/pinctrl-rza1.c | |
parent | bb949ed9b16ba4575c76f7be55d4279e35ddccc1 (diff) | |
download | linux-1e0afd470e26f83c674ff239dd5b5347cdc24fdb.tar.bz2 |
pinctrl: renesas: rza1: Replace custom code by gpiochip_node_count() call
Since we have generic function to count GPIO controller nodes
under a given device, there is no need to open code it. Replace
custom code by gpiochip_node_count() call.
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: Geert Uytterhoeven <geert+renesas@glider.be>
Diffstat (limited to 'drivers/pinctrl/renesas/pinctrl-rza1.c')
-rw-r--r-- | drivers/pinctrl/renesas/pinctrl-rza1.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/drivers/pinctrl/renesas/pinctrl-rza1.c b/drivers/pinctrl/renesas/pinctrl-rza1.c index c1d6e9512c7a..acc00b1a955d 100644 --- a/drivers/pinctrl/renesas/pinctrl-rza1.c +++ b/drivers/pinctrl/renesas/pinctrl-rza1.c @@ -1154,21 +1154,6 @@ static const struct pinmux_ops rza1_pinmux_ops = { * RZ/A1 pin controller driver operations */ -static unsigned int rza1_count_gpio_chips(struct device_node *np) -{ - struct device_node *child; - unsigned int count = 0; - - for_each_child_of_node(np, child) { - if (!of_property_read_bool(child, "gpio-controller")) - continue; - - count++; - } - - return count; -} - /** * rza1_parse_gpiochip() - parse and register a gpio chip and pin range * @@ -1255,7 +1240,7 @@ static int rza1_gpio_register(struct rza1_pinctrl *rza1_pctl) unsigned int i; int ret; - ngpiochips = rza1_count_gpio_chips(np); + ngpiochips = gpiochip_node_count(rza1_pctl->dev); if (ngpiochips == 0) { dev_dbg(rza1_pctl->dev, "No gpiochip registered\n"); return 0; |