mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/4] phy: fix deep probe support
Date: Wed,  6 Jul 2022 16:21:02 +0200	[thread overview]
Message-ID: <20220706142105.2266956-2-m.felsch@pengutronix.de> (raw)
In-Reply-To: <20220706142105.2266956-1-m.felsch@pengutronix.de>

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@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




  reply	other threads:[~2022-07-06 14:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06 14:21 [PATCH 0/4] MX8MN-EVK DDR4 Support Marco Felsch
2022-07-06 14:21 ` Marco Felsch [this message]
2022-07-07 14:39   ` [PATCH 1/4] phy: fix deep probe support Johannes Zink
2022-07-06 14:21 ` [PATCH 2/4] phy: propagate error in of_phy_get_by_phandle Marco Felsch
2022-07-07 14:39   ` Johannes Zink
2022-07-06 14:21 ` [PATCH 3/4] usb: chipidea: imx: call enable_clk after all resources are requested Marco Felsch
2022-07-07 14:40   ` Johannes Zink
2022-07-06 14:21 ` [PATCH 4/4] ARM: i.MX8MN: pass along correct DT depending on variant Marco Felsch
2022-07-11  9:22 ` [PATCH 0/4] MX8MN-EVK DDR4 Support Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220706142105.2266956-2-m.felsch@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox