From: Richard Acayan <mailingradian@gmail.com>
To: Hans de Goede <hdegoede@redhat.com>, Helge Deller <deller@gmx.de>,
Thierry Reding <treding@nvidia.com>,
linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org
Cc: Richard Acayan <mailingradian@gmail.com>
Subject: [PATCH] fbdev/simplefb: Suppress error on missing power domains
Date: Tue, 21 Nov 2023 19:54:59 -0500 [thread overview]
Message-ID: <20231122005457.330066-3-mailingradian@gmail.com> (raw)
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
next reply other threads:[~2023-11-22 0:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-22 0:54 Richard Acayan [this message]
2023-11-22 9:51 ` [PATCH] fbdev/simplefb: Suppress error on missing power domains Hans de Goede
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=20231122005457.330066-3-mailingradian@gmail.com \
--to=mailingradian@gmail.com \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=hdegoede@redhat.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=treding@nvidia.com \
/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;
as well as URLs for NNTP newsgroup(s).