Commit 9c689432 authored by Richard Acayan's avatar Richard Acayan Committed by Hans de Goede

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: 92a511a5 ("fbdev/simplefb: Add support for generic power-domains")
Closes: https://lore.kernel.org/linux-fbdev/ZVwFNfkqjrvhFHM0@radianSigned-off-by: default avatarRichard Acayan <mailingradian@gmail.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231122005457.330066-3-mailingradian@gmail.com
parent a4dea9a0
...@@ -466,6 +466,10 @@ static int simplefb_attach_genpds(struct simplefb_par *par, ...@@ -466,6 +466,10 @@ static int simplefb_attach_genpds(struct simplefb_par *par,
err = of_count_phandle_with_args(dev->of_node, "power-domains", err = of_count_phandle_with_args(dev->of_node, "power-domains",
"#power-domain-cells"); "#power-domain-cells");
if (err < 0) { 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); dev_info(dev, "failed to parse power-domains: %d\n", err);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment