phy: Return NULL if the phy is optional
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Mon, 4 Sep 2017 12:53:13 +0000 (14:53 +0200)
committerKishon Vijay Abraham I <kishon@ti.com>
Mon, 23 Oct 2017 05:49:25 +0000 (11:19 +0530)
If we're trying to get a handle to an optional phy, then the phy framework
being disabled shouldn't return an hard error.

Instead, return NULL just like phy_optional_get does when there's no phy
provided in the DT.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
include/linux/phy/phy.h

index e694d40..10888a7 100644 (file)
@@ -291,7 +291,7 @@ static inline struct phy *devm_phy_get(struct device *dev, const char *string)
 static inline struct phy *devm_phy_optional_get(struct device *dev,
                                                const char *string)
 {
-       return ERR_PTR(-ENOSYS);
+       return NULL;
 }
 
 static inline struct phy *devm_of_phy_get(struct device *dev,