Re: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check

2017-09-08 Thread Linus Walleij
On Thu, Sep 7, 2017 at 11:39 PM, Florian Fainelli wrote: > I think it means CONFIG_GPIOLIB=n in the kernel because it's not needed, > yet you run code (like drivers/net/phy/mdio_bus.c) that unconditionally > calls into GPIOLIB and attempts to configure a given GPIO if

RE: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check

2017-09-08 Thread Woojung.Huh
> >> I think it means CONFIG_GPIOLIB=n in the kernel because it's not needed, > >> yet you run code (like drivers/net/phy/mdio_bus.c) that unconditionally > >> calls into GPIOLIB and attempts to configure a given GPIO if available. > > Yes. I'm facing issue on PC which won't need GPIOLIB as

Re: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check

2017-09-08 Thread Florian Fainelli
On 09/07/2017 02:51 PM, woojung@microchip.com wrote: > If someone is using GPIO descriptors with GPIO disabled, i.e. calling > gpiod_get() and friends, this is very likely to be a bug, and what > the driver wants to do is: > > depends on GPIOLIB > > or > >

RE: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check

2017-09-07 Thread Woojung.Huh
> >>> If someone is using GPIO descriptors with GPIO disabled, i.e. calling > >>> gpiod_get() and friends, this is very likely to be a bug, and what > >>> the driver wants to do is: > >>> > >>> depends on GPIOLIB > >>> > >>> or > >>> > >>> select GPIOLIB > >>> > >>> in Kconfig. The whole

Re: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check

2017-09-07 Thread Florian Fainelli
On 09/07/2017 02:33 PM, Linus Walleij wrote: > On Thu, Sep 7, 2017 at 11:30 PM, wrote: >>> If someone is using GPIO descriptors with GPIO disabled, i.e. calling >>> gpiod_get() and friends, this is very likely to be a bug, and what >>> the driver wants to do is: >>>

Re: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check

2017-09-07 Thread Linus Walleij
On Thu, Sep 7, 2017 at 11:30 PM, wrote: >> If someone is using GPIO descriptors with GPIO disabled, i.e. calling >> gpiod_get() and friends, this is very likely to be a bug, and what >> the driver wants to do is: >> >> depends on GPIOLIB >> >> or >> >> select GPIOLIB

RE: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check

2017-09-07 Thread Woojung.Huh
> If someone is using GPIO descriptors with GPIO disabled, i.e. calling > gpiod_get() and friends, this is very likely to be a bug, and what > the driver wants to do is: > > depends on GPIOLIB > > or > > select GPIOLIB > > in Kconfig. The whole optional thing is mainly a leftover from when

Re: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check

2017-08-02 Thread Linus Walleij
On Tue, Jul 18, 2017 at 3:32 PM, Andrew Lunn wrote: > On Tue, Jul 18, 2017 at 09:52:51AM -0300, Fabio Estevam wrote: >> On Tue, Jul 18, 2017 at 9:48 AM, Sergei Shtylyov >> wrote: >> > On 07/18/2017 03:39 PM, Fabio Estevam wrote: >> > >> >>>

Re: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check

2017-07-19 Thread Fabio Estevam
Hi Andrew, On Tue, Jul 18, 2017 at 10:32 AM, Andrew Lunn wrote: > http://elixir.free-electrons.com/linux/latest/source/include/linux/gpio/consumer.h#L345 > static inline void gpiod_set_value_cansleep(struct gpio_desc *desc, int value) > { > /* GPIO can never have been

Re: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check

2017-07-18 Thread Andrew Lunn
On Tue, Jul 18, 2017 at 09:52:51AM -0300, Fabio Estevam wrote: > On Tue, Jul 18, 2017 at 9:48 AM, Sergei Shtylyov > wrote: > > On 07/18/2017 03:39 PM, Fabio Estevam wrote: > > > >>>Won't this result in kernel WARNING when GPIO is disabled? > > > > > >

Re: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check

2017-07-18 Thread Sergei Shtylyov
On 07/18/2017 04:09 PM, Fabio Estevam wrote: No, it does -- devm_gpiod_get_optinal() will return NULL in that case, bus->reset_gpio will remanin NULL, and you're removing the NULL checks around the gpiod_set_value_cansleep() calls. Perhaps it's the problem in the GPIO support though... It

Re: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check

2017-07-18 Thread Fabio Estevam
On Tue, Jul 18, 2017 at 10:02 AM, Sergei Shtylyov wrote: >No, it does -- devm_gpiod_get_optinal() will return NULL in that case, > bus->reset_gpio will remanin NULL, and you're removing the NULL checks > around the gpiod_set_value_cansleep() calls. Perhaps

Re: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check

2017-07-18 Thread Sergei Shtylyov
On 07/18/2017 03:52 PM, Fabio Estevam wrote: Won't this result in kernel WARNING when GPIO is disabled? GPIO support, I was going to type... Not sure if I understood your point, but gpiod_set_value_cansleep() is a no-op when the gpiod is NULL. Look at the stub in , it has

Re: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check

2017-07-18 Thread Fabio Estevam
On Tue, Jul 18, 2017 at 9:48 AM, Sergei Shtylyov wrote: > On 07/18/2017 03:39 PM, Fabio Estevam wrote: > >>>Won't this result in kernel WARNING when GPIO is disabled? > > >GPIO support, I was going to type... > >> Not sure if I understood your point,

Re: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check

2017-07-18 Thread Sergei Shtylyov
On 07/18/2017 03:39 PM, Fabio Estevam wrote: Won't this result in kernel WARNING when GPIO is disabled? GPIO support, I was going to type... Not sure if I understood your point, but gpiod_set_value_cansleep() is a no-op when the gpiod is NULL. Look at the stub in , it has

Re: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check

2017-07-18 Thread Fabio Estevam
On Tue, Jul 18, 2017 at 6:56 AM, Sergei Shtylyov wrote: >Won't this result in kernel WARNING when GPIO is disabled? Not sure if I understood your point, but gpiod_set_value_cansleep() is a no-op when the gpiod is NULL.

Re: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check

2017-07-18 Thread Sergei Shtylyov
Hello! On 7/18/2017 12:09 AM, Fabio Estevam wrote: From: Fabio Estevam The gpiod API checks for NULL descriptors, so there is no need to duplicate the check in the driver. Won't this result in kernel WARNING when GPIO is disabled? Signed-off-by: Fabio Estevam

Re: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check

2017-07-17 Thread David Miller
From: Fabio Estevam Date: Mon, 17 Jul 2017 18:09:09 -0300 > From: Fabio Estevam > > The gpiod API checks for NULL descriptors, so there is no need to > duplicate the check in the driver. > > Signed-off-by: Fabio Estevam

Re: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check

2017-07-17 Thread Andrew Lunn
On Mon, Jul 17, 2017 at 06:09:09PM -0300, Fabio Estevam wrote: > From: Fabio Estevam > > The gpiod API checks for NULL descriptors, so there is no need to > duplicate the check in the driver. > Signed-off-by: Fabio Estevam VALIDATE_DESC is ugly.