1 From cc8e5932c671ba2d3ce511a15c19c47b015bc4ab Mon Sep 17 00:00:00 2001
2 From: Hans de Goede <hdegoede@redhat.com>
3 Date: Sun, 5 Jan 2014 00:00:30 +0100
4 Subject: [PATCH] phy-core: phy_get: Leave error logging to the caller
6 In various cases errors may be expected, ie probe-deferral or a call to
7 phy_get from a driver where the use of a phy is optional.
9 Rather then adding all sort of complicated checks for this, and/or adding
10 special functions like devm_phy_get_optional, simply don't log an error,
11 and let deciding if get_phy returning an error really should result in a
12 dev_err up to the caller.
14 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
16 drivers/phy/phy-core.c | 10 ++--------
17 1 file changed, 2 insertions(+), 8 deletions(-)
19 diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
20 index 5f5b0f4..b355553 100644
21 --- a/drivers/phy/phy-core.c
22 +++ b/drivers/phy/phy-core.c
23 @@ -404,17 +404,11 @@ struct phy *phy_get(struct device *dev, const char *string)
24 index = of_property_match_string(dev->of_node, "phy-names",
26 phy = of_phy_get(dev, index);
28 - dev_err(dev, "unable to find phy\n");
32 phy = phy_lookup(dev, string);
34 - dev_err(dev, "unable to find phy\n");
41 if (!try_module_get(phy->ops->owner))
42 return ERR_PTR(-EPROBE_DEFER);