diff options
author | Peng Fan <peng.fan@nxp.com> | 2024-05-04 15:20:09 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2024-06-26 11:57:55 +0200 |
commit | 7c2aabb56f925a1f68373e857bce170e2fd29b46 (patch) | |
tree | 5614455c40923d53b3b7b868c2c4401f96e93ab0 /drivers/pinctrl/pinctrl-at91-pio4.c | |
parent | pinctrl: rockchip: Use scope based of_node_put() cleanups (diff) | |
download | linux-7c2aabb56f925a1f68373e857bce170e2fd29b46.tar.xz linux-7c2aabb56f925a1f68373e857bce170e2fd29b46.zip |
pinctrl: at91: Use scope based of_node_put() cleanups
Use scope based of_node_put() cleanup to simplify code.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/20240504-pinctrl-cleanup-v2-11-26c5f2dc1181@nxp.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-at91-pio4.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-at91-pio4.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c index a27c01fcbb47..8b01d312305a 100644 --- a/drivers/pinctrl/pinctrl-at91-pio4.c +++ b/drivers/pinctrl/pinctrl-at91-pio4.c @@ -632,7 +632,6 @@ static int atmel_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, struct pinctrl_map **map, unsigned int *num_maps) { - struct device_node *np; unsigned int reserved_maps; int ret; @@ -648,13 +647,11 @@ static int atmel_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, ret = atmel_pctl_dt_subnode_to_map(pctldev, np_config, map, &reserved_maps, num_maps); if (ret) { - for_each_child_of_node(np_config, np) { + for_each_child_of_node_scoped(np_config, np) { ret = atmel_pctl_dt_subnode_to_map(pctldev, np, map, &reserved_maps, num_maps); - if (ret < 0) { - of_node_put(np); + if (ret < 0) break; - } } } |