diff options
author | Rene van Paassen <rene.vanpaassen@gmail.com> | 2007-05-21 00:32:12 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2007-07-10 00:35:17 -0400 |
commit | 0112db36ef95e5632db071297f7df130725c47b9 (patch) | |
tree | 1ce114a268211b98df62b4703c628c5823476b83 /drivers/input/tablet | |
parent | b3b6cf1d47508a04de859d357789a3fc0cf8c690 (diff) |
Input: aiptek - tolerate newlines in sysfs files
Now echo "some value" > /sys/......./somefile is also acceptable.
Signed-off-by: Rene van Paassen <rene.vanpaassen@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/tablet')
-rw-r--r-- | drivers/input/tablet/aiptek.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c index 0c78dc4ed5cf..54c8d6f49833 100644 --- a/drivers/input/tablet/aiptek.c +++ b/drivers/input/tablet/aiptek.c | |||
@@ -375,8 +375,11 @@ static int map_str_to_val(const struct aiptek_map *map, const char *str, size_t | |||
375 | { | 375 | { |
376 | const struct aiptek_map *p; | 376 | const struct aiptek_map *p; |
377 | 377 | ||
378 | if (str[count - 1] == '\n') | ||
379 | count--; | ||
380 | |||
378 | for (p = map; p->string; p++) | 381 | for (p = map; p->string; p++) |
379 | if (!strncmp(str, p->string, count)) | 382 | if (!strncmp(str, p->string, count)) |
380 | return p->value; | 383 | return p->value; |
381 | 384 | ||
382 | return AIPTEK_INVALID_VALUE; | 385 | return AIPTEK_INVALID_VALUE; |