Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1726051 > unrolled thread

[PATCH] phy: Return NULL if the phy is optional

Started byMaxime Ripard <maxime.ripard@free-electrons.com>
First post2017-09-04 15:00 +0200
Last post2017-09-04 15:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] phy: Return NULL if the phy is optional Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-09-04 15:00 +0200

#1726051 — [PATCH] phy: Return NULL if the phy is optional

FromMaxime Ripard <maxime.ripard@free-electrons.com>
Date2017-09-04 15:00 +0200
Subject[PATCH] phy: Return NULL if the phy is optional
Message-ID<ulZ8R-5Dc-9@gated-at.bofh.it>
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>
---
 include/linux/phy/phy.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index 78bb0d7f6b11..76487b8d74ea 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -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,
-- 
2.13.5

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web