mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 01:10:04 +00:00
Revert "mdio_bus: Remove unneeded gpiod NULL check"
This reverts commit95b80bf3db
("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:95b80bf3db
("mdio_bus: Remove unneeded gpiod NULL check") Reported-by: Woojung Huh <Woojung.Huh@microchip.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a7bc57749f
commit
a010a2f654
1 changed files with 4 additions and 2 deletions
|
@ -399,7 +399,8 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner)
|
|||
}
|
||||
|
||||
/* Put PHYs in RESET to save power */
|
||||
gpiod_set_value_cansleep(bus->reset_gpiod, 1);
|
||||
if (bus->reset_gpiod)
|
||||
gpiod_set_value_cansleep(bus->reset_gpiod, 1);
|
||||
|
||||
device_del(&bus->dev);
|
||||
return err;
|
||||
|
@ -424,7 +425,8 @@ void mdiobus_unregister(struct mii_bus *bus)
|
|||
}
|
||||
|
||||
/* Put PHYs in RESET to save power */
|
||||
gpiod_set_value_cansleep(bus->reset_gpiod, 1);
|
||||
if (bus->reset_gpiod)
|
||||
gpiod_set_value_cansleep(bus->reset_gpiod, 1);
|
||||
|
||||
device_del(&bus->dev);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue