summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDaniel Brát <danek.brat@gmail.com>2021-10-20 10:39:54 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-03-08 09:57:59 +0100
commit5957797805e8a3fab201a3a647af13510efd6151 (patch)
tree3b7b7ddd7a45b7d17b75b1bc0086ab16aa19d078 /include
parent3a74a01a44eb794e604651ab969432df30570359 (diff)
downloadbarebox-5957797805e8a3fab201a3a647af13510efd6151.tar.gz
barebox-5957797805e8a3fab201a3a647af13510efd6151.tar.xz
phy: core: Make 'phy_optional_get' return NULL when not implemented
Make 'phy_optional_get' return NULL instead of ERR_PTR(-ENOSYS) when the CONFIG_GENERIC_PHY is not enabled. It makes more sense to return NULL instead of straight up throwing a error since the function has 'optional' in its name. This also fixes dwc2 usb driver which would previously fail inside its probe function despite being able to function without a phy just fine. Signed-off-by: Daniel Brát <danek.brat@gmail.com> Link: https://lore.barebox.org/20211020083954.3787-1-danek.brat@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/phy/phy.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index 679ce6e420..321e546f90 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -195,7 +195,7 @@ static inline struct phy *phy_get(struct device_d *dev, const char *string)
static inline struct phy *phy_optional_get(struct device_d *dev,
const char *string)
{
- return ERR_PTR(-ENOSYS);
+ return NULL;
}
static inline struct phy *of_phy_get_by_phandle(struct device_d *dev,