From: Kishon Vijay Abraham I <kishon@ti.com>
To: <gregkh@linuxfoundation.org>, <linux-kernel@vger.kernel.org>
Cc: <kishon@ti.com>
Subject: [PATCH 5/8] phy-core: phy_get: Leave error logging to the caller
Date: Mon, 17 Feb 2014 14:29:22 +0530 [thread overview]
Message-ID: <1392627565-1829-6-git-send-email-kishon@ti.com> (raw)
In-Reply-To: <1392627565-1829-1-git-send-email-kishon@ti.com>
From: Hans de Goede <hdegoede@redhat.com>
In various cases errors may be expected, ie probe-deferral or a call to
phy_get from a driver where the use of a phy is optional.
Rather then adding all sort of complicated checks for this, and/or adding
special functions like devm_phy_get_optional, simply don't log an error,
and let deciding if get_phy returning an error really should result in a
dev_err up to the caller.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
drivers/phy/phy-core.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index 5f5b0f4..b355553 100644
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -404,17 +404,11 @@ 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))
+ return phy;
if (!try_module_get(phy->ops->owner))
return ERR_PTR(-EPROBE_DEFER);
--
1.7.10.4
next prev parent reply other threads:[~2014-02-17 9:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-17 8:59 [GIT PULL 0/8] PHY subsystem fixes for 3.14-rc4 Kishon Vijay Abraham I
2014-02-17 8:59 ` [PATCH 1/8] usb: phy: twl4030-usb: Silence checkpatch warnings Kishon Vijay Abraham I
2014-02-18 20:11 ` Greg KH
2014-02-17 8:59 ` [PATCH 2/8] usb: phy: twl4030-usb: Remove redundant semicolon Kishon Vijay Abraham I
2014-02-18 20:11 ` Greg KH
2014-02-17 8:59 ` [PATCH 3/8] usb: phy: bcm-kona-usb2: Use PTR_ERR_OR_ZERO Kishon Vijay Abraham I
2014-02-18 20:11 ` Greg KH
2014-02-19 5:37 ` Kishon Vijay Abraham I
2014-02-17 8:59 ` [PATCH 4/8] phy,phy-bcm-kona-usb2.c: Add dependency on HAS_IOMEM Kishon Vijay Abraham I
2014-02-17 8:59 ` Kishon Vijay Abraham I [this message]
2014-02-17 8:59 ` [PATCH 6/8] phy-core: Don't propagate -ENOSUPP from phy_pm_runtime_get_sync to caller Kishon Vijay Abraham I
2014-02-17 8:59 ` [PATCH 7/8] phy-core: Don't allow building phy-core as a module Kishon Vijay Abraham I
2014-02-17 8:59 ` [PATCH 8/8] phy: let phy_provider_register be the last step in registering PHY Kishon Vijay Abraham I
2014-02-18 20:10 ` [GIT PULL 0/8] PHY subsystem fixes for 3.14-rc4 Greg KH
2014-02-19 5:42 ` Kishon Vijay Abraham I
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=1392627565-1829-6-git-send-email-kishon@ti.com \
--to=kishon@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@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
Powered by JetHome