summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGrygorii Strashko <grygorii.strashko@ti.com>2020-11-19 21:34:46 +0100
committerJakub Kicinski <kuba@kernel.org>2020-11-21 03:39:58 +0100
commit0a12ad5929556195fbdf1c58a14ec8e5b01b006c (patch)
treecc5f454e0f62e509529240083c4574b1854565ef /drivers
parentr8169: use dev_err_probe in rtl_get_ether_clk (diff)
downloadlinux-0a12ad5929556195fbdf1c58a14ec8e5b01b006c.tar.xz
linux-0a12ad5929556195fbdf1c58a14ec8e5b01b006c.zip
mdio_bus: suppress err message for reset gpio EPROBE_DEFER
The mdio_bus may have dependencies from GPIO controller and so got deferred. Now it will print error message every time -EPROBE_DEFER is returned which from: __mdiobus_register() |-devm_gpiod_get_optional() without actually identifying error code. "mdio_bus 4a101000.mdio: mii_bus 4a101000.mdio couldn't get reset GPIO" Hence, suppress error message for devm_gpiod_get_optional() returning -EPROBE_DEFER case by using dev_err_probe(). Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Link: https://lore.kernel.org/r/20201119203446.20857-1-grygorii.strashko@ti.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/phy/mdio_bus.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index e59067c64e97..2b42e46066b4 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -546,10 +546,11 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner)
/* de-assert bus level PHY GPIO reset */
gpiod = devm_gpiod_get_optional(&bus->dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(gpiod)) {
- dev_err(&bus->dev, "mii_bus %s couldn't get reset GPIO\n",
- bus->id);
+ err = dev_err_probe(&bus->dev, PTR_ERR(gpiod),
+ "mii_bus %s couldn't get reset GPIO\n",
+ bus->id);
device_del(&bus->dev);
- return PTR_ERR(gpiod);
+ return err;
} else if (gpiod) {
bus->reset_gpiod = gpiod;