mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] PWM: core: fix deep probe for PWM backlight
Date: Tue,  6 May 2025 08:19:47 +0200	[thread overview]
Message-ID: <20250506061947.3087695-1-a.fatoum@pengutronix.de> (raw)

In a deep probe system, resources are probed on demand. This requires
code that iterates over lists of resources to first call
of_device_ensure_probed to ensure that the device is probed and added to
the list.

This was missing for both PWM and backlights, so add them now.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/pwm/core.c        | 2 ++
 drivers/video/backlight.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 4dd18d9446aa..313f3eef6504 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -198,6 +198,8 @@ static struct pwm_device *of_node_to_pwm_device(struct device_node *np, int id)
 {
 	struct pwm_device *pwm;
 
+	of_device_ensure_probed(np);
+
 	list_for_each_entry(pwm, &pwm_list, node) {
 		if (pwm->hwdev && pwm->hwdev->of_node == np &&
 				pwm->chip->id == id)
diff --git a/drivers/video/backlight.c b/drivers/video/backlight.c
index d171b0d960d2..523dd7e9f324 100644
--- a/drivers/video/backlight.c
+++ b/drivers/video/backlight.c
@@ -93,6 +93,8 @@ struct backlight_device *of_backlight_find(struct device_node *node)
 {
 	struct backlight_device *bl;
 
+	of_device_ensure_probed(node);
+
 	list_for_each_entry(bl, &backlights, list)
 		if (bl->node == node)
 			return bl;
-- 
2.39.5




             reply	other threads:[~2025-05-06  6:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-06  6:19 Ahmad Fatoum [this message]
2025-05-06  7:18 ` 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=20250506061947.3087695-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@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