Skip to contentSkip to conversation

fbdev/simplefb: Suppress error on missing power domains

PATCH In review Richard Acayan 2 participants 2 messages Nov 22, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fbdev/simplefb: Suppress error on missing power domains

When the power domains are missing, the call to of_count_phandle_with_args fails with -ENOENT. The power domains are not required and there are some device trees that do not specify them. Suppress this error to fix devices without power domains attached to simplefb.

Fixes 92a511a568e4 ("fbdev/simplefb: Add support for generic power-domains")
---
 drivers/video/fbdev/simplefb.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/video/fbdev/simplefb.c +4 -0
index fe682af63827..6f58ee276ad1 100644
@@ -466,6 +466,10 @@ static int simplefb_attach_genpds(struct simplefb_par *par,
 	err = of_count_phandle_with_args(dev->of_node, "power-domains",
 					 "#power-domain-cells");
 	if (err < 0) {
+		/* Nothing wrong if optional PDs are missing */
+		if (err == -ENOENT)
+			return 0;
+
 		dev_info(dev, "failed to parse power-domains: %d\n", err);
 		return err;
 	}
Signature · 1 line
2.43.0
#1 lore raw

Hi,

Quoted 8 lines · Richard Acayan

When the power domains are missing, the call to of_count_phandle_with_args fails with -ENOENT. The power domains are not required and there are some device trees that do not specify them. Suppress this error to fix devices without power domains attached to simplefb.

Fixes 92a511a568e4 ("fbdev/simplefb: Add support for generic power-domains")

Thank you for the patch.

I've pushed this to drm-misc-next now.

Regards,

Hans

Quoted 19 lines
---
 drivers/video/fbdev/simplefb.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/video/fbdev/simplefb.c +4 -0
index fe682af63827..6f58ee276ad1 100644
@@ -466,6 +466,10 @@ static int simplefb_attach_genpds(struct simplefb_par *par,
 	err = of_count_phandle_with_args(dev->of_node, "power-domains",
 					 "#power-domain-cells");
 	if (err < 0) {
+		/* Nothing wrong if optional PDs are missing */
+		if (err == -ENOENT)
+			return 0;
+
 		dev_info(dev, "failed to parse power-domains: %d\n", err);
 		return err;
 	}