aboutsummaryrefslogtreecommitdiff
path: root/drivers/leds
diff options
context:
space:
mode:
authorChethan Krishna N <chethan.krishna@stericsson.com>2011-01-21 16:54:15 +0530
committerSrinidhi KASAGAR <srinidhi.kasagar@stericsson.com>2011-01-24 07:09:33 +0100
commit4cd376a20101352583a9b88e0a8edec545db8ae8 (patch)
tree04a08f96d531761224f24f86e45c7e0374adccff /drivers/leds
parente664cbee01de04fddcd8c816a68d81d00310315f (diff)
leds-lp5521:Removing multiple error messages on probe failure
leds-lp5521 will now error out on the first failure of i2c in probe. ST-Ericsson ID: ER320587 Change-Id: Ia4005e5b4bfaead658a6218ff2e662fe28ae4f71 Signed-off-by: Chethan Krishna N <chethan.krishna@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13169 Reviewed-by: QATOOLS Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com> Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-lp5521.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c
index 2defd3ea8a7..8f412c6b2f0 100644
--- a/drivers/leds/leds-lp5521.c
+++ b/drivers/leds/leds-lp5521.c
@@ -109,21 +109,37 @@ static int lp5521_configure(struct i2c_client *client)
/* Enable chip and set light to logarithmic mode */
ret |= lp5521_write(client, LP5521_REG_ENABLE, 0xc0);
+ if (ret < 0)
+ return ret;
/* setting all color pwms to direct control mode */
ret |= lp5521_write(client, LP5521_REG_OP_MODE, 0x3f);
+ if (ret < 0)
+ return ret;
/* setting current to 4.7 mA for all channels */
ret |= lp5521_write(client, LP5521_REG_R_CNTRL, LP5521_CURRENT_4m7);
+ if (ret < 0)
+ return ret;
ret |= lp5521_write(client, LP5521_REG_G_CNTRL, LP5521_CURRENT_4m7);
+ if (ret < 0)
+ return ret;
ret |= lp5521_write(client, LP5521_REG_B_CNTRL, LP5521_CURRENT_4m7);
+ if (ret < 0)
+ return ret;
/* Enable auto-powersave, set charge pump to auto, red to battery */
ret |= lp5521_write(client, LP5521_REG_MISC, 0x3c);
+ if (ret < 0)
+ return ret;
/* initialize all channels pwm to zero */
ret |= lp5521_write(client, LP5521_REG_R_PWM, 0);
+ if (ret < 0)
+ return ret;
ret |= lp5521_write(client, LP5521_REG_G_PWM, 0);
+ if (ret < 0)
+ return ret;
ret |= lp5521_write(client, LP5521_REG_B_PWM, 0);
/* Not much can be done about errors at this point */