aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/psmouse-base.c
diff options
context:
space:
mode:
authorJJ Ding <dgdunix@gmail.com>2011-11-09 13:20:14 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-11-10 00:23:26 -0500
commit76496e7a02e99d42844f4fffa145b81e513e7acd (patch)
tree33812cc8a9b250a95cf90c237c46ec6fc6fcf2ff /drivers/input/mouse/psmouse-base.c
parent7cf801cfc0774b777aa6861cf4a43a90b112b1ed (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/mouse/psmouse-base.c')
-rw-r--r--drivers/input/mouse/psmouse-base.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 9f352fbd7b4f..a6973e575aa9 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -1558,13 +1558,12 @@ static ssize_t psmouse_show_int_attr(struct psmouse *psmouse, void *offset, char
1558static ssize_t psmouse_set_int_attr(struct psmouse *psmouse, void *offset, const char *buf, size_t count) 1558static ssize_t psmouse_set_int_attr(struct psmouse *psmouse, void *offset, const char *buf, size_t count)
1559{ 1559{
1560 unsigned int *field = (unsigned int *)((char *)psmouse + (size_t)offset); 1560 unsigned int *field = (unsigned int *)((char *)psmouse + (size_t)offset);
1561 unsigned long value; 1561 unsigned int value;
1562 1562 int err;
1563 if (strict_strtoul(buf, 10, &value))
1564 return -EINVAL;
1565 1563
1566 if ((unsigned int)value != value) 1564 err = kstrtouint(buf, 10, &value);
1567 return -EINVAL; 1565 if (err)
1566 return err;
1568 1567
1569 *field = value; 1568 *field = value;
1570 1569
@@ -1671,10 +1670,12 @@ static ssize_t psmouse_attr_set_protocol(struct psmouse *psmouse, void *data, co
1671 1670
1672static ssize_t psmouse_attr_set_rate(struct psmouse *psmouse, void *data, const char *buf, size_t count) 1671static ssize_t psmouse_attr_set_rate(struct psmouse *psmouse, void *data, const char *buf, size_t count)
1673{ 1672{
1674 unsigned long value; 1673 unsigned int value;
1674 int err;
1675 1675
1676 if (strict_strtoul(buf, 10, &value)) 1676 err = kstrtouint(buf, 10, &value);
1677 return -EINVAL; 1677 if (err)
1678 return err;
1678 1679
1679 psmouse->set_rate(psmouse, value); 1680 psmouse->set_rate(psmouse, value);
1680 return count; 1681 return count;
@@ -1682,10 +1683,12 @@ static ssize_t psmouse_attr_set_rate(struct psmouse *psmouse, void *data, const
1682 1683
1683static ssize_t psmouse_attr_set_resolution(struct psmouse *psmouse, void *data, const char *buf, size_t count) 1684static ssize_t psmouse_attr_set_resolution(struct psmouse *psmouse, void *data, const char *buf, size_t count)
1684{ 1685{
1685 unsigned long value; 1686 unsigned int value;
1687 int err;
1686 1688
1687 if (strict_strtoul(buf, 10, &value)) 1689 err = kstrtouint(buf, 10, &value);
1688 return -EINVAL; 1690 if (err)
1691 return err;
1689 1692
1690 psmouse->set_resolution(psmouse, value); 1693 psmouse->set_resolution(psmouse, value);
1691 return count; 1694 return count;