diff options
author | John W. Linville <linville@tuxdriver.com> | 2006-05-17 14:51:24 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-05-17 14:51:24 -0400 |
commit | 5dd8816aeb1f068ade0349a22009ff7a66f25413 (patch) | |
tree | c56ff327b1dfa8868b4208aea9ac4158e3bfe308 /drivers/leds/led-class.c | |
parent | f03cc4fd927357bd4b3cea1a053b9f9d8f1731cc (diff) | |
parent | 0c056c50a6218e0e577817c16ba8851af593d742 (diff) |
Merge branch 'from-linus' into upstream
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 b0b5d05fadd6..c75d0ef1609c 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/sysdev.h> | 19 | #include <linux/sysdev.h> |
20 | #include <linux/timer.h> | 20 | #include <linux/timer.h> |
21 | #include <linux/err.h> | 21 | #include <linux/err.h> |
22 | #include <linux/ctype.h> | ||
22 | #include <linux/leds.h> | 23 | #include <linux/leds.h> |
23 | #include "leds.h" | 24 | #include "leds.h" |
24 | 25 | ||
@@ -43,9 +44,13 @@ static ssize_t led_brightness_store(struct class_device *dev, | |||
43 | ssize_t ret = -EINVAL; | 44 | ssize_t ret = -EINVAL; |
44 | char *after; | 45 | char *after; |
45 | unsigned long state = simple_strtoul(buf, &after, 10); | 46 | unsigned long state = simple_strtoul(buf, &after, 10); |
47 | size_t count = after - buf; | ||
46 | 48 | ||
47 | if (after - buf > 0) { | 49 | if (*after && isspace(*after)) |
48 | ret = after - buf; | 50 | count++; |
51 | |||
52 | if (count == size) { | ||
53 | ret = count; | ||
49 | led_set_brightness(led_cdev, state); | 54 | led_set_brightness(led_cdev, state); |
50 | } | 55 | } |
51 | 56 | ||