diff options
| author | Bryan O'Donoghue <bryan.odonoghue@linaro.org> | 2026-09-18 14:56:38 +0100 |
|---|---|---|
| committer | Vinod Koul <vkoul@kernel.org> | 2026-09-23 18:00:28 +0530 |
| commit | 2ee4e00dc1a38bf7bbe128825a63c6b523480c33 (patch) | |
| tree | f58756afcd80b2c18da1c2bb5842a1c8fe405e59 /include/linux | |
| parent | 89c5ae2b19619e41f9098011667fc1f59c9f322c (diff) | |
phy: core: Add devm_phy_get_by_of_node()
Add a devm variant of phy_get_by_of_node() to allow for the familiar
pattern of having devres automatically release resources on the driver's
exit path.
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20260918-b4-linux-next-25-03-13-dtsi-x1e80100-camss-v20-3-dc244e124e71@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/phy/phy.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index 71c2e1639713..14b924a88411 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h @@ -285,6 +285,7 @@ struct phy *devm_of_phy_optional_get(struct device *dev, struct device_node *np, struct phy *devm_of_phy_get_by_index(struct device *dev, struct device_node *np, int index); struct phy *phy_get_by_of_node(struct device_node *np); +struct phy *devm_phy_get_by_of_node(struct device *dev, struct device_node *np); void of_phy_put(struct phy *phy); void phy_put(struct device *dev, struct phy *phy); void devm_phy_put(struct device *dev, struct phy *phy); @@ -499,6 +500,12 @@ static inline struct phy *phy_get_by_of_node(struct device_node *np) return ERR_PTR(-ENOSYS); } +static inline struct phy *devm_phy_get_by_of_node(struct device *dev, + struct device_node *np) +{ + return ERR_PTR(-ENOSYS); +} + static inline void of_phy_put(struct phy *phy) { } |
