[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <88b2b76f-ab02-4d3d-9503-1122e9c2b538@app.fastmail.com>
Date: Thu, 24 Jul 2025 16:36:11 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Andy Shevchenko" <andriy.shevchenko@...ux.intel.com>,
"Bartosz Golaszewski" <brgl@...ev.pl>
Cc: "Arnd Bergmann" <arnd@...nel.org>,
"Linus Walleij" <linus.walleij@...aro.org>, "Peng Fan" <peng.fan@....com>,
"Lee Jones" <lee@...nel.org>, "Koichiro Den" <koichiro.den@...onical.com>,
"Geert Uytterhoeven" <geert+renesas@...der.be>,
"Alexander Sverdlin" <alexander.sverdlin@...il.com>,
Uwe Kleine-König <ukleinek@...nel.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] gpiolib: make legacy interfaces optional
On Wed, Jul 23, 2025, at 16:17, Andy Shevchenko wrote:
> On Wed, Jul 23, 2025 at 10:39:32AM +0200, Bartosz Golaszewski wrote:
>> On Tue, Jul 22, 2025 at 5:36 PM Arnd Bergmann <arnd@...nel.org> wrote:
>
> ...
>
>> > +#ifdef CONFIG_GPIOLIB
>> > +#include <linux/gpio/consumer.h>
>>
>> I want to queue this ASAP but do we really need this guard here?
>> consumer.h already guards against !CONFIG_GPIOLIB internally, right?
>
> I probably missed something, but I do not understand why we need this include
> at all in the gpio.h.
We've been thinning out linux/gpio.h over the years on both the contents
and the inclusions, but I'm fairly sure that out of the 173 files that
still include it, the majority actually need the consumer interfaces.
One thing I've considered doing here was to make this file only contain
two lines
#include <linux/gpio/consumer.h>
#include <linux/gpio/legacy.h>
then then replace all of the remaining users with one or the other
in order to remove linux/gpio.h completely.
I think both approaches are useful and can be combined, but the
CONFIG_GPIOLIB_LEGACY patch seems sufficient for now.
If you want to experiment with the other one, you could try
my whole series and drop the #include <linux/gpio/consumer.h>
line to find all the instances in allmodconfig builds that should
use that in place of linux/gpio.h.
Arnd
Powered by blists - more mailing lists