[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201118142426.25369-1-grygorii.strashko@ti.com>
Date: Wed, 18 Nov 2020 16:24:26 +0200
From: Grygorii Strashko <grygorii.strashko@...com>
To: "David S. Miller" <davem@...emloft.net>, <netdev@...r.kernel.org>,
Jakub Kicinski <kuba@...nel.org>, Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>
CC: <linux-kernel@...r.kernel.org>,
Grygorii Strashko <grygorii.strashko@...com>
Subject: [PATCH] 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 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 when devm_gpiod_get_optional() returning
-EPROBE_DEFER case.
Signed-off-by: Grygorii Strashko <grygorii.strashko@...com>
---
drivers/net/phy/mdio_bus.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 757e950fb745..54fc13043656 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 = PTR_ERR(gpiod);
+ if (err != -EPROBE_DEFER)
+ dev_err(&bus->dev, "mii_bus %s couldn't get reset GPIO %d\n", bus->id, err);
device_del(&bus->dev);
- return PTR_ERR(gpiod);
+ return err;
} else if (gpiod) {
bus->reset_gpiod = gpiod;
--
2.17.1
Powered by blists - more mailing lists