devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] video: mxsfb: get supply regulator optionally
@ 2016-09-04  4:26 Stefan Agner
  2016-09-06  8:21 ` Tomi Valkeinen
       [not found] ` <20160904042627.30182-1-stefan-XLVq0VzYD2Y@public.gmane.org>
  0 siblings, 2 replies; 8+ messages in thread
From: Stefan Agner @ 2016-09-04  4:26 UTC (permalink / raw)
  To: plagnioj-sclMFOaUSTBWk0Htik3J/w, tomi.valkeinen-l0cyMroinI0
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Stefan Agner

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-XLVq0VzYD2Y@public.gmane.org>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-11-09  0:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-04  4:26 [PATCH] video: mxsfb: get supply regulator optionally Stefan Agner
2016-09-06  8:21 ` Tomi Valkeinen
     [not found]   ` <f8368040-bb5a-91e0-7511-df462719b949-l0cyMroinI0@public.gmane.org>
2016-09-06 18:23     ` Stefan Agner
2016-09-06 22:22       ` Mark Brown
     [not found]       ` <4b3a7bda2202a536efaf4a693234c273-XLVq0VzYD2Y@public.gmane.org>
2016-09-07  7:20         ` Tomi Valkeinen
     [not found]           ` <1812b2bf-bd66-3553-4c2d-3d2b08603ca0-l0cyMroinI0@public.gmane.org>
2016-09-12 23:47             ` Mark Brown
2016-11-09  0:16             ` Stefan Agner
     [not found] ` <20160904042627.30182-1-stefan-XLVq0VzYD2Y@public.gmane.org>
2016-09-12 15:47   ` Rob Herring

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).