Re: [PATCH] gpio: swnode: remove deprecated lookup mechanism
From: Bartosz Golaszewski
Date: Mon Jun 29 2026 - 10:18:06 EST
On Mon, 29 Jun 2026 15:10:40 +0200, Andy Shevchenko
<andriy.shevchenko@xxxxxxxxx> said:
> On Mon, Jun 29, 2026 at 12:54:58PM +0200, Bartosz Golaszewski wrote:
>> GPIO software node lookup should rely exclusively on matching the
>> addresses of the referenced firmware nodes. Commit e5d527be7e69 ("gpio:
>> swnode: don't use the swnode's name as the key for GPIO lookup") tried to
>> enforce this but had to be reverted: it broke existing users who abused
>> the software node mechanism by creating "dummy" software nodes named
>> after the device they want to get GPIOs from, without ever attaching them
>> to the actual GPIO devices. Those users relied on GPIOLIB matching the
>> label of the GPIO controller against the name of the software node rather
>> than on a real firmware node link.
>>
>> All such users have now been coverted to using attached software nodes
>> via the fwnode address lookup path and the kernel documentation has been
>> updated to recommend it as the correct approach. This allows us to remove
>> the old behavior.
>>
>> This will allow us to leverage the upcoming support for fw_devlink for
>> software nodes in GPIO core.
>
> I am in favour of this,
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
> (but I prefer cleaner diff, see below).
>
> ...
>
>> fwnode_lookup:
>> - gdev = gpio_device_find_by_fwnode(fwnode);
>
>> - return gdev ?: ERR_PTR(-EPROBE_DEFER);
>
>
> Can we simply leave these two instead?
>
Honestly, that's just personal preference. I prefer the oneliner.
Bart