Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: k210: 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-19-26c5f2dc1181@nxp.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Peng Fan and committed by
Linus Walleij
3a882554 7f500f20

+2 -5
+2 -5
drivers/pinctrl/pinctrl-k210.c
··· 849 849 unsigned int *num_maps) 850 850 { 851 851 unsigned int reserved_maps; 852 - struct device_node *np; 853 852 int ret; 854 853 855 854 reserved_maps = 0; ··· 860 861 if (ret < 0) 861 862 goto err; 862 863 863 - for_each_available_child_of_node(np_config, np) { 864 + for_each_available_child_of_node_scoped(np_config, np) { 864 865 ret = k210_pinctrl_dt_subnode_to_map(pctldev, np, map, 865 866 &reserved_maps, num_maps); 866 - if (ret < 0) { 867 - of_node_put(np); 867 + if (ret < 0) 868 868 goto err; 869 - } 870 869 } 871 870 return 0; 872 871