Re: [PATCH v2 7/8] gpiolib: remove gpio_to_chip

From: Arnd Bergmann
Date: Tue Nov 09 2021 - 05:54:41 EST


On Tue, Nov 9, 2021 at 11:32 AM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> 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