aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-lm3530.c
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2012-09-12 02:34:09 -0400
committerBryan Wu <bryan.wu@canonical.com>2012-09-12 03:05:00 -0400
commite0e021600e3ebb80d6539cc5f8de8f9d19687e80 (patch)
tree7cb8f780d242178982d41a44ee3bed9196d70907 /drivers/leds/leds-lm3530.c
parenta47df97c9936cff6d31f03e12651ad897e0e374c (diff)
leds-lm3530: Fix smatch warnings
Fixes the following smatch warnings: drivers/leds/leds-lm3530.c:361 lm3530_mode_set() info: why not propagate 'mode' from lm3530_get_mode_from_str() instead of -22? drivers/leds/leds-lm3530.c:432 lm3530_probe() info: why not propagate 'err' from lm3530_init_registers() instead of -19? drivers/leds/leds-lm3530.c:438 lm3530_probe() info: why not propagate 'err' from led_classdev_register() instead of -19? Reported-by: Fengguang Wu <fengguang.wu@intel.com> Cc: Shreshtha Kumar SAHU <shreshthakumar.sahu@stericsson.com> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Diffstat (limited to 'drivers/leds/leds-lm3530.c')
-rw-r--r--drivers/leds/leds-lm3530.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/leds/leds-lm3530.c b/drivers/leds/leds-lm3530.c
index 1e7ed2abfdcc..b26306f6724d 100644
--- a/drivers/leds/leds-lm3530.c
+++ b/drivers/leds/leds-lm3530.c
@@ -150,7 +150,7 @@ static int lm3530_get_mode_from_str(const char *str)
150 if (sysfs_streq(str, mode_map[i].mode)) 150 if (sysfs_streq(str, mode_map[i].mode))
151 return mode_map[i].mode_val; 151 return mode_map[i].mode_val;
152 152
153 return -1; 153 return -EINVAL;
154} 154}
155 155
156static void lm3530_als_configure(struct lm3530_platform_data *pdata, 156static void lm3530_als_configure(struct lm3530_platform_data *pdata,
@@ -358,7 +358,7 @@ static ssize_t lm3530_mode_set(struct device *dev, struct device_attribute
358 mode = lm3530_get_mode_from_str(buf); 358 mode = lm3530_get_mode_from_str(buf);
359 if (mode < 0) { 359 if (mode < 0) {
360 dev_err(dev, "Invalid mode\n"); 360 dev_err(dev, "Invalid mode\n");
361 return -EINVAL; 361 return mode;
362 } 362 }
363 363
364 drvdata->mode = mode; 364 drvdata->mode = mode;
@@ -429,13 +429,13 @@ static int __devinit lm3530_probe(struct i2c_client *client,
429 if (err < 0) { 429 if (err < 0) {
430 dev_err(&client->dev, 430 dev_err(&client->dev,
431 "Register Init failed: %d\n", err); 431 "Register Init failed: %d\n", err);
432 return -ENODEV; 432 return err;
433 } 433 }
434 } 434 }
435 err = led_classdev_register(&client->dev, &drvdata->led_dev); 435 err = led_classdev_register(&client->dev, &drvdata->led_dev);
436 if (err < 0) { 436 if (err < 0) {
437 dev_err(&client->dev, "Register led class failed: %d\n", err); 437 dev_err(&client->dev, "Register led class failed: %d\n", err);
438 return -ENODEV; 438 return err;
439 } 439 }
440 440
441 err = device_create_file(drvdata->led_dev.dev, &dev_attr_mode); 441 err = device_create_file(drvdata->led_dev.dev, &dev_attr_mode);