From: Rene van Paassen Date: Mon, 21 May 2007 04:32:12 +0000 (-0400) Subject: Input: aiptek - tolerate newlines in sysfs files X-Git-Tag: v2.6.23-rc1~1179 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=0112db36ef95e5632db071297f7df130725c47b9;p=linux-2.6-omap-h63xx.git Input: aiptek - tolerate newlines in sysfs files Now echo "some value" > /sys/......./somefile is also acceptable. Signed-off-by: Rene van Paassen Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c index 0c78dc4ed5c..54c8d6f4983 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 { const struct aiptek_map *p; + if (str[count - 1] == '\n') + count--; + for (p = map; p->string; p++) - if (!strncmp(str, p->string, count)) + if (!strncmp(str, p->string, count)) return p->value; return AIPTEK_INVALID_VALUE;