]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
leds-add-led-driver-for-lm3556-chip-checkpatch-fixes
authorAndrew Morton <akpm@linux-foundation.org>
Wed, 4 Apr 2012 00:08:30 +0000 (10:08 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 11 Apr 2012 04:45:53 +0000 (14:45 +1000)
WARNING: please write a paragraph that describes the config symbol fully
#31: FILE: drivers/leds/Kconfig:397:
+config LEDS_LM3556

ERROR: "foo * bar" should be "foo *bar"
#201: FILE: drivers/leds/leds-lm3556.c:143:
+int lm3556_read_reg(struct i2c_client *client, u8 reg, u8 * val)

WARNING: simple_strtoul is obsolete, use kstrtoul instead
#380: FILE: drivers/leds/leds-lm3556.c:322:
+ unsigned long state = simple_strtoul(buf, &after, 10);

total: 1 errors, 2 warnings, 727 lines checked

./patches/leds-add-led-driver-for-lm3556-chip.patch has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

Cc: Axel Lin <axel.lin@gmail.com>
Cc: Daniel Jeong <daniel.jeong@ti.com>
Cc: Geon Si Jeong <gshark.jeong@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/leds/leds-lm3556.c

index f6185f66c94d5eb4e14b094756447a4d872c0aea..fb08d2600ba3a51e1e5e07c094b4e16ef3a68999 100644 (file)
@@ -141,7 +141,7 @@ static struct indicator indicator_pattern[INDIC_PATTERN_SIZE] = {
 };
 
 /* i2c access*/
-int lm3556_read_reg(struct i2c_client *client, u8 reg, u8 * val)
+int lm3556_read_reg(struct i2c_client *client, u8 reg, u8 *val)
 {
        int ret;
        struct lm3556_chip_data *chip = i2c_get_clientdata(client);
@@ -317,12 +317,15 @@ static ssize_t lm3556_indicator_pattern_store(struct device *dev,
                                              const char *buf, size_t size)
 {
        char *after;
-       ssize_t ret = -EINVAL;
+       ssize_t ret;
        struct i2c_client *client = container_of(dev->parent,
                                                 struct i2c_client, dev);
-       unsigned long state = simple_strtoul(buf, &after, 10);
+       unsigned long state;
        size_t count = after - buf;
 
+       ret = kstrtoul(buf, 10, &state);
+       if (ret)
+               goto out;
        if (isspace(*after))
                count++;
 
@@ -336,6 +339,7 @@ static ssize_t lm3556_indicator_pattern_store(struct device *dev,
                lm3556_write_reg(client, REG_INDIC_PERIOD,
                                 indicator_pattern[state].period_cnt);
        }
+out:
        return ret;
 }