Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Maxime Ripard and committed by
Kishon Vijay Abraham I
11a6e41c 5954a10e

+1 -1
+1 -1
include/linux/phy/phy.h
··· 291 291 static inline struct phy *devm_phy_optional_get(struct device *dev, 292 292 const char *string) 293 293 { 294 - return ERR_PTR(-ENOSYS); 294 + return NULL; 295 295 } 296 296 297 297 static inline struct phy *devm_of_phy_get(struct device *dev,