From: Heiner Kallweit <hkallweit1@gmail.com>
To: Grygorii Strashko <grygorii.strashko@ti.com>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
Andrew Lunn <andrew@lunn.ch>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mdio_bus: suppress err message for reset gpio EPROBE_DEFER
Date: Thu, 19 Nov 2020 13:30:09 +0100 [thread overview]
Message-ID: <0329ed05-371b-0bb5-4f85-75ecaff6a70b@gmail.com> (raw)
In-Reply-To: <20201118142426.25369-1-grygorii.strashko@ti.com>
Am 18.11.2020 um 15:24 schrieb Grygorii Strashko:
> 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@ti.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;
>
>
Using dev_err_probe() here would simplify the code.
next prev parent reply other threads:[~2020-11-19 12:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-18 14:24 [PATCH] mdio_bus: suppress err message for reset gpio EPROBE_DEFER Grygorii Strashko
2020-11-19 12:30 ` Heiner Kallweit [this message]
2020-11-19 13:38 ` Grygorii Strashko
2020-11-19 16:58 ` Heiner Kallweit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0329ed05-371b-0bb5-4f85-75ecaff6a70b@gmail.com \
--to=hkallweit1@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=grygorii.strashko@ti.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).