Re: [PATCH] net: phy: at803x: don't depend on GPIOLIB

From: Sebastian Frias
Date: Wed Mar 23 2016 - 06:12:23 EST


Hi Uwe,

On 03/22/2016 08:42 PM, Uwe Kleine-König wrote:
> Hello Sebastian,
>
> On Tue, Mar 22, 2016 at 03:34:23PM +0100, Sebastian Frias wrote:
>> I think we are in a deadlock :-)
>> I'm going to reply inline below, but I will also send a different email
>> to Daniel with a small recap.
>> I think he should share the intent of the "reset" mechanism he
>> introduced, in particular if it is mandatory.
>
> The things I said in my mail are valid in general, not only for the
> at803x phy.
>
> Let me repeat them once more:
>
> Preconditions:
> - Some of the devices a given driver handles have a reset line and
> others don't.
> - A non-empty subset (maybe all) of the devices that have a reset line
> require that this reset line is used.
>
> Then the way to handle this in the driver should be done as follows:
>
> unless reset_handling_not_necessary():
> gpio = gpiod_get_optional("reset")
> if IS_ERR(gpio):
> return PTR_ERR(gpio)
>
> Checking for -ENOSYS or GPIOLIB=n is not allowed because the device
> you're currently handling might need the GPIO, so you must not continue
> without the ability to control the line.
>
> So the options you have (as you have a phy that doesn't need the reset
> handling):
>
> - enable GPIOLIB (either in your .config or introduce a Kconfig
> dependency)
> - improve reset_handling_not_necessary() to return true for your case
>

I will see if I can "improve reset_handling_not_necessary() to return true".

Best regards,

Sebastian