Re: [PATCH v3] gpiolib: fix linker errors when GPIOLIB is disabled

From: Andy Shevchenko
Date: Wed Jan 25 2023 - 13:22:15 EST


On Tue, Jan 24, 2023 at 09:54:54AM +0100, Bartosz Golaszewski wrote:
> On Tue, Jan 24, 2023 at 2:31 AM Pierluigi Passaro
> <pierluigi.p@xxxxxxxxxxxxx> wrote:

...

> > #else /* CONFIG_GPIOLIB */
> >
> > +#include <linux/gpio/machine.h>
> > +#include <linux/gpio/consumer.h>
>
> Please move those headers to the top and arrange them alphabetically
> with the rest of the <linux/ headers. Since you're now including
> those, remove any forward declarations of the types in question.

That's not correct way. The headers will make the whole purpose of splitting
(between driver, machine, and consumer) useless.

Lemme look at it, but I believe the solution is not so simple.
We need to clean up header inclusions as we did for pin control.

--
With Best Regards,
Andy Shevchenko