[PATCH] PWM: core: fix deep probe for PWM backlight

Ahmad Fatoum a.fatoum at pengutronix.de
Mon May 5 23:19:47 PDT 2025


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




More information about the barebox mailing list