diff options
| author | KaiGai Kohei <kaigai@ak.jp.nec.com> | 2006-05-19 00:43:53 +0900 |
|---|---|---|
| committer | KaiGai Kohei <kaigai@ak.jp.nec.com> | 2006-05-19 00:43:53 +0900 |
| commit | 20a92fc74c5c91c7bc5693d51acc2b99aceb0465 (patch) | |
| tree | 41bf535f38ff1a29c560bcf622e9b4ef03c2c106 /drivers/leds/led-class.c | |
| parent | 21b9879bf2817aca343cdda11ade6a87f5373e74 (diff) | |
| parent | f6a673b3f4f93c1c50e1b18f29254b0531b722a8 (diff) | |
Merge git://git.infradead.org/mtd-2.6
Diffstat (limited to 'drivers/leds/led-class.c')
| -rw-r--r-- | drivers/leds/led-class.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index b0b5d05fadd..c75d0ef1609 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c @@ -19,6 +19,7 @@ #include <linux/sysdev.h> #include <linux/timer.h> #include <linux/err.h> +#include <linux/ctype.h> #include <linux/leds.h> #include "leds.h" @@ -43,9 +44,13 @@ static ssize_t led_brightness_store(struct class_device *dev, ssize_t ret = -EINVAL; char *after; unsigned long state = simple_strtoul(buf, &after, 10); + size_t count = after - buf; - if (after - buf > 0) { - ret = after - buf; + if (*after && isspace(*after)) + count++; + + if (count == size) { + ret = count; led_set_brightness(led_cdev, state); } |
