From 76496e7a02e99d42844f4fffa145b81e513e7acd Mon Sep 17 00:00:00 2001 From: JJ Ding Date: Wed, 9 Nov 2011 10:20:14 -0800 Subject: Input: convert obsolete strict_strtox to kstrtox With commit 67d0a0754455f89ef3946946159d8ec9e45ce33a we mark strict_strtox as obsolete. Convert all remaining such uses in drivers/input/. Also change long to appropriate types, and return error conditions from kstrtox separately, as Dmitry sugguests. Signed-off-by: JJ Ding Signed-off-by: Dmitry Torokhov --- drivers/input/tablet/aiptek.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'drivers/input/tablet') diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c index 6d89fd1842c3..85bace2c8fe8 100644 --- a/drivers/input/tablet/aiptek.c +++ b/drivers/input/tablet/aiptek.c @@ -1198,9 +1198,9 @@ static ssize_t store_tabletXtilt(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct aiptek *aiptek = dev_get_drvdata(dev); - long x; + int x; - if (strict_strtol(buf, 10, &x)) { + if (kstrtoint(buf, 10, &x)) { size_t len = buf[count - 1] == '\n' ? count - 1 : count; if (strncmp(buf, "disable", len)) @@ -1240,9 +1240,9 @@ static ssize_t store_tabletYtilt(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct aiptek *aiptek = dev_get_drvdata(dev); - long y; + int y; - if (strict_strtol(buf, 10, &y)) { + if (kstrtoint(buf, 10, &y)) { size_t len = buf[count - 1] == '\n' ? count - 1 : count; if (strncmp(buf, "disable", len)) @@ -1277,12 +1277,13 @@ static ssize_t store_tabletJitterDelay(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct aiptek *aiptek = dev_get_drvdata(dev); - long j; + int err, j; - if (strict_strtol(buf, 10, &j)) - return -EINVAL; + err = kstrtoint(buf, 10, &j); + if (err) + return err; - aiptek->newSetting.jitterDelay = (int)j; + aiptek->newSetting.jitterDelay = j; return count; } @@ -1306,12 +1307,13 @@ static ssize_t store_tabletProgrammableDelay(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct aiptek *aiptek = dev_get_drvdata(dev); - long d; + int err, d; - if (strict_strtol(buf, 10, &d)) - return -EINVAL; + err = kstrtoint(buf, 10, &d); + if (err) + return err; - aiptek->newSetting.programmableDelay = (int)d; + aiptek->newSetting.programmableDelay = d; return count; } @@ -1557,11 +1559,13 @@ static ssize_t store_tabletWheel(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct aiptek *aiptek = dev_get_drvdata(dev); - long w; + int err, w; - if (strict_strtol(buf, 10, &w)) return -EINVAL; + err = kstrtoint(buf, 10, &w); + if (err) + return err; - aiptek->newSetting.wheel = (int)w; + aiptek->newSetting.wheel = w; return count; } -- cgit v1.2.3-55-g7522