* [PATCH] fbdev/simplefb: Suppress error on missing power domains
@ 2023-11-22 0:54 Richard Acayan
2023-11-22 9:51 ` Hans de Goede
0 siblings, 1 reply; 2+ messages in thread
From: Richard Acayan @ 2023-11-22 0:54 UTC (permalink / raw)
To: Hans de Goede, Helge Deller, Thierry Reding, linux-fbdev,
dri-devel
Cc: 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")
Closes: https://lore.kernel.org/linux-fbdev/ZVwFNfkqjrvhFHM0@radian
Signed-off-by: Richard Acayan <mailingradian@gmail.com>
---
drivers/video/fbdev/simplefb.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
index fe682af63827..6f58ee276ad1 100644
--- a/drivers/video/fbdev/simplefb.c
+++ b/drivers/video/fbdev/simplefb.c
@@ -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;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fbdev/simplefb: Suppress error on missing power domains
2023-11-22 0:54 [PATCH] fbdev/simplefb: Suppress error on missing power domains Richard Acayan
@ 2023-11-22 9:51 ` Hans de Goede
0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2023-11-22 9:51 UTC (permalink / raw)
To: Richard Acayan, Helge Deller, Thierry Reding, linux-fbdev,
dri-devel
Hi,
On 11/22/23 01:54, Richard Acayan wrote:
> 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")
> Closes: https://lore.kernel.org/linux-fbdev/ZVwFNfkqjrvhFHM0@radian
> Signed-off-by: Richard Acayan <mailingradian@gmail.com>
Thank you for the patch.
I've pushed this to drm-misc-next now.
Regards,
Hans
> ---
> drivers/video/fbdev/simplefb.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
> index fe682af63827..6f58ee276ad1 100644
> --- a/drivers/video/fbdev/simplefb.c
> +++ b/drivers/video/fbdev/simplefb.c
> @@ -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;
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-22 9:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-22 0:54 [PATCH] fbdev/simplefb: Suppress error on missing power domains Richard Acayan
2023-11-22 9:51 ` Hans de Goede
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).