aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/hgpk.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/hgpk.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/hgpk.c')
-rw-r--r--drivers/input/mouse/hgpk.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/input/mouse/hgpk.c b/drivers/input/mouse/hgpk.c
index 0470dd46b566..1c5d521de600 100644
--- a/drivers/input/mouse/hgpk.c
+++ b/drivers/input/mouse/hgpk.c
@@ -789,11 +789,14 @@ static ssize_t hgpk_set_powered(struct psmouse *psmouse, void *data,
789 const char *buf, size_t count) 789 const char *buf, size_t count)
790{ 790{
791 struct hgpk_data *priv = psmouse->private; 791 struct hgpk_data *priv = psmouse->private;
792 unsigned long value; 792 unsigned int value;
793 int err; 793 int err;
794 794
795 err = strict_strtoul(buf, 10, &value); 795 err = kstrtouint(buf, 10, &value);
796 if (err || value > 1) 796 if (err)
797 return err;
798
799 if (value > 1)
797 return -EINVAL; 800 return -EINVAL;
798 801
799 if (value != priv->powered) { 802 if (value != priv->powered) {
@@ -881,11 +884,14 @@ static ssize_t hgpk_trigger_recal(struct psmouse *psmouse, void *data,
881 const char *buf, size_t count) 884 const char *buf, size_t count)
882{ 885{
883 struct hgpk_data *priv = psmouse->private; 886 struct hgpk_data *priv = psmouse->private;
884 unsigned long value; 887 unsigned int value;
885 int err; 888 int err;
886 889
887 err = strict_strtoul(buf, 10, &value); 890 err = kstrtouint(buf, 10, &value);
888 if (err || value != 1) 891 if (err)
892 return err;
893
894 if (value != 1)
889 return -EINVAL; 895 return -EINVAL;
890 896
891 /* 897 /*