From 160f1fef7e52e974489b3c70fbd4e094c06965c2 Mon Sep 17 00:00:00 2001 From: Joe Rouvier Date: Sun, 10 Aug 2008 00:29:25 -0400 Subject: 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 --- drivers/input/touchscreen/ads7846.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index ce6f48c695f..efbbbe48621 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) -- cgit v1.2.3