浏览代码

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.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Maxime Ripard 8 年之前
父节点
当前提交
11a6e41c0e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      include/linux/phy/phy.h

+ 1 - 1
include/linux/phy/phy.h

@@ -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,