projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/netdev-2.6
[powerpc.git]
/
drivers
/
leds
/
led-class.c
diff --git
a/drivers/leds/led-class.c
b/drivers/leds/led-class.c
index
b0b5d05
..
c75d0ef
100644
(file)
--- 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/sysdev.h>
#include <linux/timer.h>
#include <linux/err.h>
+#include <linux/ctype.h>
#include <linux/leds.h>
#include "leds.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);
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);
}
led_set_brightness(led_cdev, state);
}