[PATCH v2 7/8] gpiolib: remove gpio_to_chip

Arnd Bergmann arnd at kernel.org
Tue Nov 9 02:54:21 PST 2021


On Tue, Nov 9, 2021 at 11:32 AM Andy Shevchenko
<andriy.shevchenko at linux.intel.com> wrote:
>
> >  #ifdef CONFIG_GPIOLIB
>
> I'm wondering if we need this ifdeffery at all.

We don't need it for the first half (gpio_set_value, gpio_direction_input, ...),
which could just be unconditional wrappers around the gpiod versions.
Removing that #ifdef would require always including linux/gpio/consumer.h
here, so we'd no longer get a build failure when a driver uses gpiod_*
without including that directly (when GPIOLIB is disabled).

I actually had a patch in my series to do this, but dropped that because
the second half (gpio_request/gpio_free/...) does need the #ifdef

         Arnd



More information about the linux-arm-kernel mailing list