From: kishon@ti.com (Kishon Vijay Abraham I)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] phy-core: Don't print an error on probe deferral or nodata
Date: Tue, 7 Jan 2014 15:01:02 +0530 [thread overview]
Message-ID: <52CBC956.6050106@ti.com> (raw)
In-Reply-To: <1388963189-13556-1-git-send-email-hdegoede@redhat.com>
Hi,
On Monday 06 January 2014 04:36 AM, Hans de Goede wrote:
> Printing an error on probe-deferral clearly is not the right thing to do.
> While at it I've also silenced the error in case of -ENODATA, so that
> devm_phy_get can be used to get an optional phy without causing errors to
What do you mean by optional phy here?
Thanks
Kishon
> be printed. Alternatively a new devm_phy_get_optional method could be
> added for this.
>
> While at it also factor the error handling out of the if ... else ..., as it
> is identical in both branches.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/phy/phy-core.c | 14 ++++++--------
> 1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> index 58e0e97..d7b992e 100644
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c
> @@ -371,16 +371,14 @@ struct phy *phy_get(struct device *dev, const char *string)
> index = of_property_match_string(dev->of_node, "phy-names",
> string);
> phy = of_phy_get(dev, index);
> - if (IS_ERR(phy)) {
> - dev_err(dev, "unable to find phy\n");
> - return phy;
> - }
> } else {
> phy = phy_lookup(dev, string);
> - if (IS_ERR(phy)) {
> - dev_err(dev, "unable to find phy\n");
> - return phy;
> - }
> + }
> + if (IS_ERR(phy)) {
> + int err = PTR_ERR(phy);
> + if (err != -EPROBE_DEFER && err != -ENODATA)
> + dev_err(dev, "unable to get phy\n");
> + return phy;
> }
>
> if (!try_module_get(phy->ops->owner))
>
next prev parent reply other threads:[~2014-01-07 9:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-05 23:06 [PATCH 1/2] phy-core: Don't print an error on probe deferral or nodata Hans de Goede
2014-01-05 23:06 ` [PATCH 2/2] phy-core: Don't propagate -ENOSUPP from phy_pm_runtime_get_sync to caller Hans de Goede
2014-01-06 17:37 ` Sergei Shtylyov
2014-01-07 8:56 ` Kishon Vijay Abraham I
2014-01-07 8:58 ` Kishon Vijay Abraham I
2014-01-07 9:13 ` Hans de Goede
2014-01-07 9:31 ` Kishon Vijay Abraham I [this message]
2014-01-07 9:53 ` [PATCH 1/2] phy-core: Don't print an error on probe deferral or nodata Hans de Goede
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=52CBC956.6050106@ti.com \
--to=kishon@ti.com \
--cc=linux-arm-kernel@lists.infradead.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).