mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <ahmad@a3f.at>
Subject: [PATCH master 3/3] reset: core: support deep probe with resets registered in CLK_OF_DECLARE
Date: Mon,  9 Jan 2023 09:36:00 +0100	[thread overview]
Message-ID: <20230109083600.1820078-3-ahmad@a3f.at> (raw)
In-Reply-To: <20230109083600.1820078-1-ahmad@a3f.at>

We already have such an exception for clocks, which may be registered
early outside the driver model using CLK_OF_DECLARE. Add a further
exception for reset controllers, so they too may be registered in
CLK_OF_DECLARE on a deep probe system. Checking for success of
of_device_ensure_probed() here isn't necessary anyways, because if
there is no provider, the list_for_each_entry loop below won't find
any and error is propagated.

Another solution would be to rewrite deep probe drivers to use
the driver model instead of CLK_OF_DECLARE, but this error case
if not very obvious, so save others time by just allowing it.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 drivers/reset/core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/reset/core.c b/drivers/reset/core.c
index 31fac2de0347..5ab21ac95e3a 100644
--- a/drivers/reset/core.c
+++ b/drivers/reset/core.c
@@ -192,9 +192,8 @@ static struct reset_control *of_reset_control_get_by_index(struct device_node *n
 	if (ret)
 		return ERR_PTR(ret);
 
-	ret = of_device_ensure_probed(args.np);
-	if (ret)
-		return ERR_PTR(ret);
+	/* Ignore error, as CLK_OF_DECLARE resets have no proper driver. */
+	of_device_ensure_probed(args.np);
 
 	rcdev = NULL;
 	list_for_each_entry(r, &reset_controller_list, list) {
-- 
2.38.1




  parent reply	other threads:[~2023-01-09  8:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09  8:35 [PATCH master 1/3] driver: have dev_name(unregistered device) behave as expected Ahmad Fatoum
2023-01-09  8:35 ` [PATCH master 2/3] efi: acpi: add SDT resource before registering device Ahmad Fatoum
2023-01-09  8:36 ` Ahmad Fatoum [this message]
2023-01-09  9:12 ` [PATCH master 1/3] driver: have dev_name(unregistered device) behave as expected 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=20230109083600.1820078-3-ahmad@a3f.at \
    --to=ahmad@a3f.at \
    --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