Re: [PATCH] gpiolib: enable CONFIG_GPIOLIB_LEGACY even for !GPIOLIB
From: Arnd Bergmann
Date: Tue Jul 29 2025 - 10:12:35 EST
On Tue, Jul 29, 2025, at 14:12, Geert Uytterhoeven wrote:
> On Tue, 29 Jul 2025 at 13:58, Arnd Bergmann <arnd@xxxxxxxx> wrote:
>> On Tue, Jul 29, 2025, at 12:47, Geert Uytterhoeven wrote:
>> Do you have an example config that shows this problem?
>> I've tried a couple of configurations on m68k now but are unable
>> to reproduce this, using 'defconfig' (without GPIOLIB) and
>> 'm5475evb_defconfig' (with GPIOLIB).
>>
>> The intention of this patch (in combination with the previous one)
>> was that the legacy interfaces would still behave exactly like
>> before, falling back to the stubs when GPIOLIB is disabled.
>
> I haven't seen any actual failures. When discovering
> CONFIG_GPIOLIB_LEGACY=y in all m68k defconfigs, my initial worry
> was that it would increase kernel size by needlessly including
> gpiolib-legacy.o. When that didn't turn out to be true, I started
> wondering how your commit would fix anything without including
> gpiolib-legacy.o. Looks like any users just uses the simple static
> inlines...
> Sorry for confusing you.
No worries, thanks for paying attention to incoming changes!
If you want to see what the actual plan is, have a look at
https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/log/?h=config-gpio-legacy
which ends with making GPIOLIB_LEGACY actually optional.
Any driver that actually uses the legacy gpiolib interfaces
at that point is already specific to one of the few platforms
that still have legacy gpiochips (sh, sa1100, pxa, s3c64xx,
orion5x, mv78xx0, coldfire, alchemy, txx9, bcm47xx, bcm63xx,
rb532, olpc, and a few x86 atom boards), or it has an explicit
dependency on GPIOLIB_LEGACY.
The arm boards are already on their way out, but the others
could probably use some help converting to gpio descriptors.
Arnd