Thread (60 messages) 60 messages, 6 authors, 2013-06-07

[PATCH 17/32] OMAPDSS: SDI: clean up regulator init

flat view
STALE4871d

From: Tomi Valkeinen <hidden>
Date: 2013-05-30 09:34:38
Also in: linux-omap
Subsystem: framebuffer layer, the rest · Maintainers: Helge Deller, Linus Torvalds

Clean up the SDI driver's regulator init to remove the (unused)
omap_dss_device parameter, renaming the function to a more sensible
name, and making the code slightly clearer.

Signed-off-by: Tomi Valkeinen <redacted>
---
 drivers/video/omap2/dss/sdi.c | 41 +++++++++++++++++++++--------------------
 1 file changed, 21 insertions(+), 20 deletions(-)
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
index 2e3afb8..9801a6e 100644
--- a/drivers/video/omap2/dss/sdi.c
+++ b/drivers/video/omap2/dss/sdi.c
@@ -251,30 +251,31 @@ void omapdss_sdi_set_datapairs(struct omap_dss_device *dssdev, int datapairs)
 }
 EXPORT_SYMBOL(omapdss_sdi_set_datapairs);
 
-static int sdi_init_display(struct omap_dss_device *dssdev)
+static int sdi_init_regulator(void)
 {
-	DSSDBG("SDI init\n");
-
-	if (sdi.vdds_sdi_reg = NULL) {
-		struct regulator *vdds_sdi;
-
-		vdds_sdi = dss_get_vdds_sdi();
-
-		if (IS_ERR(vdds_sdi)) {
-			vdds_sdi = regulator_get(&sdi.pdev->dev, "vdds_sdi");
-			if (IS_ERR(vdds_sdi)) {
-				DSSERR("can't get VDDS_SDI regulator\n");
-				return PTR_ERR(vdds_sdi);
-			}
-			sdi.vdds_sdi_from_core = false;
-		} else {
-			sdi.vdds_sdi_from_core = true;
-		}
+	struct regulator *vdds_sdi;
+
+	if (sdi.vdds_sdi_reg != NULL)
+		return 0;
 
+	vdds_sdi = dss_get_vdds_sdi();
+
+	if (!IS_ERR(vdds_sdi)) {
+		sdi.vdds_sdi_from_core = true;
 		sdi.vdds_sdi_reg = vdds_sdi;
+		return 0;
 	}
 
-	return 0;
+	vdds_sdi = regulator_get(&sdi.pdev->dev, "vdds_sdi");
+
+	if (!IS_ERR(vdds_sdi)) {
+		sdi.vdds_sdi_from_core = false;
+		sdi.vdds_sdi_reg = vdds_sdi;
+	}
+
+	DSSERR("can't get VDDS_SDI regulator\n");
+
+	return PTR_ERR(vdds_sdi);
 }
 
 static struct omap_dss_device *sdi_find_dssdev(struct platform_device *pdev)
@@ -322,7 +323,7 @@ static int sdi_probe_pdata(struct platform_device *sdidev)
 
 	dss_copy_device_pdata(dssdev, plat_dssdev);
 
-	r = sdi_init_display(dssdev);
+	r = sdi_init_regulator();
 	if (r) {
 		DSSERR("device %s init failed: %d\n", dssdev->name, r);
 		dss_put_device(dssdev);
-- 
1.8.1.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help