Re: [PATCH] serial: imx: Avoid probe failure in case of missing gpiolib

From: Schrempf Frieder
Date: Thu Aug 01 2019 - 05:28:48 EST

Hi Uwe,

On 01.08.19 10:48, Uwe Kleine-KÃnig wrote:
> On Thu, Aug 01, 2019 at 08:18:05AM +0000, Schrempf Frieder wrote:
>> From: Frieder Schrempf <frieder.schrempf@xxxxxxxxxx>
>> If CONFIG_GPIOLIB is not enabled, mctrl_gpio_init() will return
>> -ENOSYS and cause the probing of the imx UART to fail. As the
>> GPIOs are optional, we should continue probing in this case.
> Is this really still the case? On which version did you hit this
> problem?

Yes, I think it is. I used v5.2.5, that already has d99482673f95.

> I would expect that is gone with
> d99482673f950817b30caf3fcdfb31179b050ce1 if not earlier.

I think this is a different problem. If CONFIG_GPIOLIB is disabled,
mctrl_gpio_init() returns -ENOSYS unconditionally here: [1]. The
existing patch (d99482673f95) seems to handle the case when
CONFIG_GPIOLIB is enabled, but no or not all GPIOs are given in the dtb.

The sh-sci.c driver has a similar check to skip this case: [2].