diff options
author | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-06-04 19:45:23 +0800 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-06-04 19:45:23 +0800 |
commit | a05c58e73b23211d7b8d4ea31a0519ea41d4ec3c (patch) | |
tree | b3aa7890aba1877b417e900994126bb0a6e2f359 /drivers/leds/leds-lp5521.c | |
parent | 9ce0109275e82697ada4b005325e663ba72c3181 (diff) | |
parent | f0bfbaaec3d8dfb06790c59bc5d6c848f0bbd5f8 (diff) |
Merge topic branch 'core' into integration-linux-ux500
Diffstat (limited to 'drivers/leds/leds-lp5521.c')
-rw-r--r-- | drivers/leds/leds-lp5521.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c index 410a723b869..2f667071278 100644 --- a/drivers/leds/leds-lp5521.c +++ b/drivers/leds/leds-lp5521.c @@ -355,7 +355,12 @@ static int lp5521_do_store_load(struct lp5521_engine *engine, while ((offset < len - 1) && (i < LP5521_PROGRAM_LENGTH)) { /* separate sscanfs because length is working only for %s */ ret = sscanf(buf + offset, "%2s%n ", c, &nrchars); - if (ret != 2) + /* + * Execution of a %n directive does not always + * increment the assignment count returned at + * completion of execution.so ret need not be 2 + */ + if ((ret != 1) && (ret != 2)) goto fail; ret = sscanf(c, "%2x", &cmd); if (ret != 1) @@ -787,6 +792,7 @@ static int __devinit lp5521_probe(struct i2c_client *client, ret = lp5521_read(client, LP5521_REG_R_CURRENT, &buf); if (buf != LP5521_REG_R_CURR_DEFAULT) { dev_err(&client->dev, "error in resetting chip\n"); + ret = -EIO; goto fail2; } usleep_range(10000, 20000); |