Skip to content

Commit

Permalink
OMAPDSS: TPO-TD03MTEA1: Check for errors from regulator_enable()
Browse files Browse the repository at this point in the history
It is possible for regulator_enable() to fail and if it does fail that's
generally a bad sign for anything we try to do with the hardware afterwards
so check for and immediately return an error if regulator_enable() fails.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
  • Loading branch information
Mark Brown authored and Tomi Valkeinen committed Apr 23, 2012
1 parent ec87410 commit 956107e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/video/omap2/displays/panel-tpo-td043mtea1.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,14 @@ static const struct omap_video_timings tpo_td043_timings = {
static int tpo_td043_power_on(struct tpo_td043_device *tpo_td043)
{
int nreset_gpio = tpo_td043->nreset_gpio;
int r;

if (tpo_td043->powered_on)
return 0;

regulator_enable(tpo_td043->vcc_reg);
r = regulator_enable(tpo_td043->vcc_reg);
if (r != 0)
return r;

/* wait for regulator to stabilize */
msleep(160);
Expand Down

0 comments on commit 956107e

Please sign in to comment.