On Sat, Sep 9, 2017 at 1:18 AM, Florian Fainelli <f.faine...@gmail.com> wrote: > On 09/08/2017 04:13 PM, Linus Walleij wrote: >> On Sat, Sep 9, 2017 at 12:38 AM, Florian Fainelli <f.faine...@gmail.com> >> wrote: >> >>> This reverts commit 95b80bf3db03c2bf572a357cf74b9a6aefef0a4a ("mdio_bus: >>> Remove unneeded gpiod NULL check"), this commit assumed that GPIOLIB >>> checks for NULL descriptors, so it's safe to drop them, but it is not >>> when CONFIG_GPIOLIB is disabled in the kernel. If we do call >>> gpiod_set_value_cansleep() on a GPIO descriptor we will issue warnings >>> coming from the inline stubs declared in include/linux/gpio/consumer.h. >>> >>> Fixes: 95b80bf3db03 ("mdio_bus: Remove unneeded gpiod NULL check") >>> Reported-by: Woojung Huh <woojung....@microchip.com> >>> Signed-off-by: Florian Fainelli <f.faine...@gmail.com> >> >> Yeah I guess you don't wanna have these messages spewing >> in the console. :/ >> >> But what about simply doing this: > > That would create another dependency which really does not need to be > there as it really prevents you from testing more configurations, > including but not limited to having CONFIG_GPIOLIB=n w/ > CONFIG_MDIO_DEVICE=[ym]. > > The GPIOLIB=n inline stubs have a "contract" with the code calling them > that is fairly clear, which is what this revert is leveraging.
Ayeah the contract is something like "you can call us if compiled out, but then you get warnings". Yeah NULL checks does the trick as well as #ifdef:in in that sense. It's no big deal so if you prefer this: Acked-by: Linus Walleij <linus.wall...@linaro.org> Yours, Linus Walleij