Skip to content

Commit 4614749

Browse files
miquelraynallinusw
authored andcommitted
pinctrl: nuvoton: Fix boot on ma35dx platforms
As part of a wider cleanup trying to get rid of OF specific APIs, an incorrect (and partially unrelated) cleanup was introduced. The goal was to replace a device_for_each_chil_node() loop including an additional condition inside by a macro doing both the loop and the check on a single line. The snippet: device_for_each_child_node(dev, child) if (fwnode_property_present(child, "gpio-controller")) continue; was replaced by: for_each_gpiochip_node(dev, child) which expands into: device_for_each_child_node(dev, child) for_each_if(fwnode_property_present(child, "gpio-controller")) This change is actually doing the opposite of what was initially expected, breaking the probe of this driver, breaking at the same time the whole boot of Nuvoton platforms (no more console, the kernel WARN()). Revert these two changes to roll back to the correct behavior. Fixes: 693c9ec ("pinctrl: nuvoton: Reduce use of OF-specific APIs") Cc: [email protected] Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 7d50219 commit 4614749

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/pinctrl/nuvoton/pinctrl-ma35.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,10 @@ static int ma35_pinctrl_probe_dt(struct platform_device *pdev, struct ma35_pinct
10741074
u32 idx = 0;
10751075
int ret;
10761076

1077-
for_each_gpiochip_node(dev, child) {
1077+
device_for_each_child_node(dev, child) {
1078+
if (fwnode_property_present(child, "gpio-controller"))
1079+
continue;
1080+
10781081
npctl->nfunctions++;
10791082
npctl->ngroups += of_get_child_count(to_of_node(child));
10801083
}
@@ -1092,7 +1095,10 @@ static int ma35_pinctrl_probe_dt(struct platform_device *pdev, struct ma35_pinct
10921095
if (!npctl->groups)
10931096
return -ENOMEM;
10941097

1095-
for_each_gpiochip_node(dev, child) {
1098+
device_for_each_child_node(dev, child) {
1099+
if (fwnode_property_present(child, "gpio-controller"))
1100+
continue;
1101+
10961102
ret = ma35_pinctrl_parse_functions(child, npctl, idx++);
10971103
if (ret) {
10981104
fwnode_handle_put(child);

0 commit comments

Comments
 (0)