[PATCH] pinctrl: nuvoton: Fix boot on ma35dx platforms
Miquel Raynal
miquel.raynal at bootlin.com
Mon Jun 16 01:51:42 PDT 2025
Hi Andy,
On 14/06/2025 at 00:07:51 +03, Andy Shevchenko <andy.shevchenko at gmail.com> wrote:
> On Fri, Jun 13, 2025 at 9:13 PM Miquel Raynal <miquel.raynal at bootlin.com> wrote:
>>
>> 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.
>
> Thank you for the report and the fix.
> Can we also add a comment on top of each of these if:s to prevent from
> blind change in the future?
I believe it's fine like that, The difference is subtle, it is okay and
unavoidable to make this kind of small mistake sometimes.
Cheers,
Miquèl
More information about the linux-arm-kernel
mailing list