summaryrefslogtreecommitdiff
path: root/include/linux/phy
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2023-01-24 19:37:22 +0100
committerVinod Koul <vkoul@kernel.org>2023-02-03 10:52:49 +0530
commitd02aa181ee595c81738b6bd7ebad6025fbee035a (patch)
tree6b3631822392d9685727c3bd19eeed3d406a8159 /include/linux/phy
parent59c3d3d00d60b6d75ef3faf3b24e6aac037c1085 (diff)
phy: Add devm_of_phy_optional_get() helper
Add an optional variant of devm_of_phy_get() that also takes care of printing real errors, so drivers no longer have to open-code this operation. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/4cd0069bcff424ffc5c3a102397c02370b91985b.1674584626.git.geert+renesas@glider.be Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'include/linux/phy')
-rw-r--r--include/linux/phy/phy.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index 1b4f9be21e01..3a570bc59fc7 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -254,6 +254,8 @@ struct phy *devm_phy_get(struct device *dev, const char *string);
struct phy *devm_phy_optional_get(struct device *dev, const char *string);
struct phy *devm_of_phy_get(struct device *dev, struct device_node *np,
const char *con_id);
+struct phy *devm_of_phy_optional_get(struct device *dev, struct device_node *np,
+ const char *con_id);
struct phy *devm_of_phy_get_by_index(struct device *dev, struct device_node *np,
int index);
void of_phy_put(struct phy *phy);
@@ -443,6 +445,13 @@ static inline struct phy *devm_of_phy_get(struct device *dev,
return ERR_PTR(-ENOSYS);
}
+static inline struct phy *devm_of_phy_optional_get(struct device *dev,
+ struct device_node *np,
+ const char *con_id)
+{
+ return NULL;
+}
+
static inline struct phy *devm_of_phy_get_by_index(struct device *dev,
struct device_node *np,
int index)