Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a010a2f6 authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller
Browse files

Revert "mdio_bus: Remove unneeded gpiod NULL check"



This reverts commit 95b80bf3 ("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: 95b80bf3 ("mdio_bus: Remove unneeded gpiod NULL check")
Reported-by: default avatarWoojung Huh <Woojung.Huh@microchip.com>
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a7bc5774
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -399,6 +399,7 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner)
	}

	/* Put PHYs in RESET to save power */
	if (bus->reset_gpiod)
		gpiod_set_value_cansleep(bus->reset_gpiod, 1);

	device_del(&bus->dev);
@@ -424,6 +425,7 @@ void mdiobus_unregister(struct mii_bus *bus)
	}

	/* Put PHYs in RESET to save power */
	if (bus->reset_gpiod)
		gpiod_set_value_cansleep(bus->reset_gpiod, 1);

	device_del(&bus->dev);