Skip to contentSkip to conversation

phy: Return NULL if the phy is optional

PATCH Applied Maxime Ripard 2 participants 2 messages Sep 4, 2017 – Oct 18, 2017 Generic PHY framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 phy: Return NULL if the phy is optional

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.

---
 include/linux/phy/phy.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/phy/phy.h +1 -1
index 78bb0d7f6b11..76487b8d74ea 100644
@@ -289,7 +289,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,
Signature · 1 line
2.13.5
#1 lore raw
Quoted 7 lines · Maxime Ripard

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.

merged, thanks!

-Kishon

Quoted 18 lines
---
 include/linux/phy/phy.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/phy/phy.h +1 -1
index 78bb0d7f6b11..76487b8d74ea 100644
@@ -289,7 +289,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,