diff options
author | JJ Ding <dgdunix@gmail.com> | 2011-11-09 13:20:14 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-11-10 00:23:26 -0500 |
commit | 76496e7a02e99d42844f4fffa145b81e513e7acd (patch) | |
tree | 33812cc8a9b250a95cf90c237c46ec6fc6fcf2ff /drivers/input/tablet | |
parent | 7cf801cfc0774b777aa6861cf4a43a90b112b1ed (diff) |
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 <dgdunix@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/tablet')
-rw-r--r-- | drivers/input/tablet/aiptek.c | 34 |
1 files changed, 19 insertions, 15 deletions
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 | |||
1198 | store_tabletXtilt(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | 1198 | store_tabletXtilt(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
1199 | { | 1199 | { |
1200 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1200 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1201 | long x; | 1201 | int x; |
1202 | 1202 | ||
1203 | if (strict_strtol(buf, 10, &x)) { | 1203 | if (kstrtoint(buf, 10, &x)) { |
1204 | size_t len = buf[count - 1] == '\n' ? count - 1 : count; | 1204 | size_t len = buf[count - 1] == '\n' ? count - 1 : count; |
1205 | 1205 | ||
1206 | if (strncmp(buf, "disable", len)) | 1206 | if (strncmp(buf, "disable", len)) |
@@ -1240,9 +1240,9 @@ static ssize_t | |||
1240 | store_tabletYtilt(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | 1240 | store_tabletYtilt(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
1241 | { | 1241 | { |
1242 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1242 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1243 | long y; | 1243 | int y; |
1244 | 1244 | ||
1245 | if (strict_strtol(buf, 10, &y)) { | 1245 | if (kstrtoint(buf, 10, &y)) { |
1246 | size_t len = buf[count - 1] == '\n' ? count - 1 : count; | 1246 | size_t len = buf[count - 1] == '\n' ? count - 1 : count; |
1247 | 1247 | ||
1248 | if (strncmp(buf, "disable", len)) | 1248 | if (strncmp(buf, "disable", len)) |
@@ -1277,12 +1277,13 @@ static ssize_t | |||
1277 | store_tabletJitterDelay(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | 1277 | store_tabletJitterDelay(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
1278 | { | 1278 | { |
1279 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1279 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1280 | long j; | 1280 | int err, j; |
1281 | 1281 | ||
1282 | if (strict_strtol(buf, 10, &j)) | 1282 | err = kstrtoint(buf, 10, &j); |
1283 | return -EINVAL; | 1283 | if (err) |
1284 | return err; | ||
1284 | 1285 | ||
1285 | aiptek->newSetting.jitterDelay = (int)j; | 1286 | aiptek->newSetting.jitterDelay = j; |
1286 | return count; | 1287 | return count; |
1287 | } | 1288 | } |
1288 | 1289 | ||
@@ -1306,12 +1307,13 @@ static ssize_t | |||
1306 | store_tabletProgrammableDelay(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | 1307 | store_tabletProgrammableDelay(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
1307 | { | 1308 | { |
1308 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1309 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1309 | long d; | 1310 | int err, d; |
1310 | 1311 | ||
1311 | if (strict_strtol(buf, 10, &d)) | 1312 | err = kstrtoint(buf, 10, &d); |
1312 | return -EINVAL; | 1313 | if (err) |
1314 | return err; | ||
1313 | 1315 | ||
1314 | aiptek->newSetting.programmableDelay = (int)d; | 1316 | aiptek->newSetting.programmableDelay = d; |
1315 | return count; | 1317 | return count; |
1316 | } | 1318 | } |
1317 | 1319 | ||
@@ -1557,11 +1559,13 @@ static ssize_t | |||
1557 | store_tabletWheel(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | 1559 | store_tabletWheel(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
1558 | { | 1560 | { |
1559 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1561 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1560 | long w; | 1562 | int err, w; |
1561 | 1563 | ||
1562 | if (strict_strtol(buf, 10, &w)) return -EINVAL; | 1564 | err = kstrtoint(buf, 10, &w); |
1565 | if (err) | ||
1566 | return err; | ||
1563 | 1567 | ||
1564 | aiptek->newSetting.wheel = (int)w; | 1568 | aiptek->newSetting.wheel = w; |
1565 | return count; | 1569 | return count; |
1566 | } | 1570 | } |
1567 | 1571 | ||