summaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/ads7846.c
diff options
context:
space:
mode:
authorJoe Rouvier <joe@rouvier.org>2008-08-10 00:29:25 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2008-09-10 12:11:57 -0400
commit160f1fef7e52e974489b3c70fbd4e094c06965c2 (patch)
tree80423a45a9a57736e6ce6351da0801e1a5b02b8c /drivers/input/touchscreen/ads7846.c
parent82a196f481661170b4982dc7e68a12e9253309d0 (diff)
downloadlinux-160f1fef7e52e974489b3c70fbd4e094c06965c2.tar.bz2
Input: convert drivers to use strict_strtoul()
strict_strtoul() allows newline character at the end of the the input string and therefore is more user-friendly. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/touchscreen/ads7846.c')
-rw-r--r--drivers/input/touchscreen/ads7846.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index ce6f48c695f5..efbbbe48621a 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -461,10 +461,11 @@ static ssize_t ads7846_disable_store(struct device *dev,
const char *buf, size_t count)
{
struct ads7846 *ts = dev_get_drvdata(dev);
- char *endp;
- int i;
+ long i;
+
+ if (strict_strtoul(buf, 10, &i))
+ return -EINVAL;
- i = simple_strtoul(buf, &endp, 10);
spin_lock_irq(&ts->lock);
if (i)