From: Stefan Agner <stefan@agner.ch>
To: plagnioj@jcrosoft.com, tomi.valkeinen@ti.com
Cc: robh+dt@kernel.org, mark.rutland@arm.com,
devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Stefan Agner <stefan@agner.ch>
Subject: [PATCH] video: mxsfb: get supply regulator optionally
Date: Sat, 3 Sep 2016 21:26:27 -0700 [thread overview]
Message-ID: <20160904042627.30182-1-stefan@agner.ch> (raw)
The lcd-supply is meant to be optional, there are several device-
trees not specifying it and the code handles error values silently.
Therefor, avoid creating a dummy regulator (and the associated
warning) by using devm_regulator_get_optional.
While at it, document that fact also in the device-tree bindings.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
Documentation/devicetree/bindings/display/mxsfb.txt | 3 +++
drivers/video/fbdev/mxsfb.c | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/display/mxsfb.txt b/Documentation/devicetree/bindings/display/mxsfb.txt
index 96ec517..0bc530f 100644
--- a/Documentation/devicetree/bindings/display/mxsfb.txt
+++ b/Documentation/devicetree/bindings/display/mxsfb.txt
@@ -7,6 +7,9 @@ Required properties:
- interrupts: Should contain lcdif interrupts
- display : phandle to display node (see below for details)
+Optional properties:
+- lcd-supply: Regulator for LCD supply voltage.
+
* display node
Required properties:
diff --git a/drivers/video/fbdev/mxsfb.c b/drivers/video/fbdev/mxsfb.c
index 4e6608c..4f7570f 100644
--- a/drivers/video/fbdev/mxsfb.c
+++ b/drivers/video/fbdev/mxsfb.c
@@ -920,7 +920,7 @@ static int mxsfb_probe(struct platform_device *pdev)
if (IS_ERR(host->clk_disp_axi))
host->clk_disp_axi = NULL;
- host->reg_lcd = devm_regulator_get(&pdev->dev, "lcd");
+ host->reg_lcd = devm_regulator_get_optional(&pdev->dev, "lcd");
if (IS_ERR(host->reg_lcd))
host->reg_lcd = NULL;
--
2.9.0
next reply other threads:[~2016-09-04 4:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-04 4:26 Stefan Agner [this message]
2016-09-06 8:21 ` Tomi Valkeinen
2016-09-06 18:23 ` Stefan Agner
2016-09-06 22:22 ` Mark Brown
2016-09-07 7:20 ` Tomi Valkeinen
2016-09-12 23:47 ` Mark Brown
2016-11-09 0:16 ` Stefan Agner
2016-09-12 15:47 ` Rob Herring
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=20160904042627.30182-1-stefan@agner.ch \
--to=stefan@agner.ch \
--cc=devicetree@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=plagnioj@jcrosoft.com \
--cc=robh+dt@kernel.org \
--cc=tomi.valkeinen@ti.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
all inboxes | Powered by JetHome®