Re: [PATCH RFC 1/6] ARM: pxa: Convert Spitz OHCI to GPIO descriptors

From: Linus Walleij
Date: Mon Oct 02 2023 - 04:00:21 EST


On Sun, Oct 1, 2023 at 11:22 AM Andy Shevchenko <andy@xxxxxxxxxx> wrote:

One more thing, though. I think those warnings are incomplete or actually
> reversed, and we outta use WARN_ON(IS_ERR(desc)), no?
>
> This way it will fix my concerns and your concerns will be satisfied, right?
> So, if gpiod_get() returns an error pointer and then we are trying to
> free it with GPIOLIB=n, _then_ we will got a warning and it's obvious that
> driver has to be prepared for that, otherwise if we have it NULL and
> call for gpiod_get_optional(), even with GPIOLIB=n, it's fine to free, we
> don't care.

Since we return return ERR_PTR(-ENOSYS) when compiled out
this sounds right to me!

Yours,
Linus Walleij