summaryrefslogtreecommitdiffstats
path: root/drivers/phy
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-02-17 09:59:22 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-18 21:13:15 +0100
commitf40037fd3677ae240978f469cc4155bf3ca7c076 (patch)
treeaa7cd5fc27b062f4e7b8c06b51e7459b3ef3611e /drivers/phy
parentphy,phy-bcm-kona-usb2.c: Add dependency on HAS_IOMEM (diff)
downloadlinux-f40037fd3677ae240978f469cc4155bf3ca7c076.tar.xz
linux-f40037fd3677ae240978f469cc4155bf3ca7c076.zip
phy-core: phy_get: Leave error logging to the caller
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/phy-core.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index 5f5b0f4be5be..b3555535a8c6 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);