[PATCH 1/4] phy: fix deep probe support

Marco Felsch m.felsch at pengutronix.de
Wed Jul 6 07:21:02 PDT 2022


Commit 9474a29003 ("phy: Add deep probe support") added the deep probe
support but this commit was missing the of_phy_get_by_phandle() isn't
calling the internal _of_phy_get() helper. Fix this by moving the
of_device_ensure_probed() call into the of_phy_provider_lookup() helper
which gets called by both functions.

Signed-off-by: Marco Felsch <m.felsch at pengutronix.de>
---
 drivers/phy/phy-core.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index b298da0000..ef7bd76648 100644
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -220,6 +220,11 @@ static struct phy_provider *of_phy_provider_lookup(struct device_node *node)
 {
 	struct phy_provider *phy_provider;
 	struct device_node *child;
+	int ret;
+
+	ret = of_device_ensure_probed(node);
+	if (ret)
+		return ERR_PTR(ret);
 
 	list_for_each_entry(phy_provider, &phy_provider_list, list) {
 		if (phy_provider->dev->device_node == node)
@@ -255,10 +260,6 @@ static struct phy *_of_phy_get(struct device_node *np, int index)
 	if (ret)
 		return ERR_PTR(-ENODEV);
 
-	ret = of_device_ensure_probed(args.np);
-	if (ret)
-		return ERR_PTR(ret);
-
 	phy_provider = of_phy_provider_lookup(args.np);
 	if (IS_ERR(phy_provider)) {
 		return ERR_CAST(phy_provider);
-- 
2.30.2




More information about the barebox mailing list