summaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/sdi.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-05-17 11:00:15 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-06-17 14:00:46 +0300
commitd37801b3a23c8aeeb9ab803a1b2177a8f51967d2 (patch)
treed9a14f13986b7b5c2f7cb50a92034e3902cc9611 /drivers/video/omap2/dss/sdi.c
parente25001d8be225b09a9a660f121892961bb58a09a (diff)
OMAPDSS: SDI: clean up regulator init
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 <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/sdi.c')
-rw-r--r--drivers/video/omap2/dss/sdi.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
index 6277c059385..d362fe17081 100644
--- a/drivers/video/omap2/dss/sdi.c
+++ b/drivers/video/omap2/dss/sdi.c
@@ -248,23 +248,22 @@ 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");
+ struct regulator *vdds_sdi;
- if (sdi.vdds_sdi_reg == NULL) {
- struct regulator *vdds_sdi;
-
- vdds_sdi = dss_get_vdds_sdi();
+ if (sdi.vdds_sdi_reg)
+ return 0;
- if (IS_ERR(vdds_sdi)) {
- DSSERR("can't get VDDS_SDI regulator\n");
- return PTR_ERR(vdds_sdi);
- }
+ vdds_sdi = dss_get_vdds_sdi();
- sdi.vdds_sdi_reg = vdds_sdi;
+ if (IS_ERR(vdds_sdi)) {
+ DSSERR("can't get VDDS_SDI regulator\n");
+ return PTR_ERR(vdds_sdi);
}
+ sdi.vdds_sdi_reg = vdds_sdi;
+
return 0;
}
@@ -313,7 +312,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);