aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc
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/misc
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/misc')
-rw-r--r--drivers/input/misc/adxl34x.c16
-rw-r--r--drivers/input/misc/ati_remote2.c19
2 files changed, 19 insertions, 16 deletions
diff --git a/drivers/input/misc/adxl34x.c b/drivers/input/misc/adxl34x.c
index 144ddbdeb9b3..87918592993c 100644
--- a/drivers/input/misc/adxl34x.c
+++ b/drivers/input/misc/adxl34x.c
@@ -451,10 +451,10 @@ static ssize_t adxl34x_disable_store(struct device *dev,
451 const char *buf, size_t count) 451 const char *buf, size_t count)
452{ 452{
453 struct adxl34x *ac = dev_get_drvdata(dev); 453 struct adxl34x *ac = dev_get_drvdata(dev);
454 unsigned long val; 454 unsigned int val;
455 int error; 455 int error;
456 456
457 error = strict_strtoul(buf, 10, &val); 457 error = kstrtouint(buf, 10, &val);
458 if (error) 458 if (error)
459 return error; 459 return error;
460 460
@@ -540,10 +540,10 @@ static ssize_t adxl34x_rate_store(struct device *dev,
540 const char *buf, size_t count) 540 const char *buf, size_t count)
541{ 541{
542 struct adxl34x *ac = dev_get_drvdata(dev); 542 struct adxl34x *ac = dev_get_drvdata(dev);
543 unsigned long val; 543 unsigned char val;
544 int error; 544 int error;
545 545
546 error = strict_strtoul(buf, 10, &val); 546 error = kstrtou8(buf, 10, &val);
547 if (error) 547 if (error)
548 return error; 548 return error;
549 549
@@ -575,10 +575,10 @@ static ssize_t adxl34x_autosleep_store(struct device *dev,
575 const char *buf, size_t count) 575 const char *buf, size_t count)
576{ 576{
577 struct adxl34x *ac = dev_get_drvdata(dev); 577 struct adxl34x *ac = dev_get_drvdata(dev);
578 unsigned long val; 578 unsigned int val;
579 int error; 579 int error;
580 580
581 error = strict_strtoul(buf, 10, &val); 581 error = kstrtouint(buf, 10, &val);
582 if (error) 582 if (error)
583 return error; 583 return error;
584 584
@@ -622,13 +622,13 @@ static ssize_t adxl34x_write_store(struct device *dev,
622 const char *buf, size_t count) 622 const char *buf, size_t count)
623{ 623{
624 struct adxl34x *ac = dev_get_drvdata(dev); 624 struct adxl34x *ac = dev_get_drvdata(dev);
625 unsigned long val; 625 unsigned int val;
626 int error; 626 int error;
627 627
628 /* 628 /*
629 * This allows basic ADXL register write access for debug purposes. 629 * This allows basic ADXL register write access for debug purposes.
630 */ 630 */
631 error = strict_strtoul(buf, 16, &val); 631 error = kstrtouint(buf, 16, &val);
632 if (error) 632 if (error)
633 return error; 633 return error;
634 634
diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c
index 1de58e8a1b71..afbe3e760551 100644
--- a/drivers/input/misc/ati_remote2.c
+++ b/drivers/input/misc/ati_remote2.c
@@ -41,13 +41,13 @@ static int ati_remote2_set_mask(const char *val,
41 const struct kernel_param *kp, 41 const struct kernel_param *kp,
42 unsigned int max) 42 unsigned int max)
43{ 43{
44 unsigned long mask; 44 unsigned int mask;
45 int ret; 45 int ret;
46 46
47 if (!val) 47 if (!val)
48 return -EINVAL; 48 return -EINVAL;
49 49
50 ret = strict_strtoul(val, 0, &mask); 50 ret = kstrtouint(val, 0, &mask);
51 if (ret) 51 if (ret)
52 return ret; 52 return ret;
53 53
@@ -719,11 +719,12 @@ static ssize_t ati_remote2_store_channel_mask(struct device *dev,
719 struct usb_device *udev = to_usb_device(dev); 719 struct usb_device *udev = to_usb_device(dev);
720 struct usb_interface *intf = usb_ifnum_to_if(udev, 0); 720 struct usb_interface *intf = usb_ifnum_to_if(udev, 0);
721 struct ati_remote2 *ar2 = usb_get_intfdata(intf); 721 struct ati_remote2 *ar2 = usb_get_intfdata(intf);
722 unsigned long mask; 722 unsigned int mask;
723 int r; 723 int r;
724 724
725 if (strict_strtoul(buf, 0, &mask)) 725 r = kstrtouint(buf, 0, &mask);
726 return -EINVAL; 726 if (r)
727 return r;
727 728
728 if (mask & ~ATI_REMOTE2_MAX_CHANNEL_MASK) 729 if (mask & ~ATI_REMOTE2_MAX_CHANNEL_MASK)
729 return -EINVAL; 730 return -EINVAL;
@@ -768,10 +769,12 @@ static ssize_t ati_remote2_store_mode_mask(struct device *dev,
768 struct usb_device *udev = to_usb_device(dev); 769 struct usb_device *udev = to_usb_device(dev);
769 struct usb_interface *intf = usb_ifnum_to_if(udev, 0); 770 struct usb_interface *intf = usb_ifnum_to_if(udev, 0);
770 struct ati_remote2 *ar2 = usb_get_intfdata(intf); 771 struct ati_remote2 *ar2 = usb_get_intfdata(intf);
771 unsigned long mask; 772 unsigned int mask;
773 int err;
772 774
773 if (strict_strtoul(buf, 0, &mask)) 775 err = kstrtouint(buf, 0, &mask);
774 return -EINVAL; 776 if (err)
777 return err;
775 778
776 if (mask & ~ATI_REMOTE2_MAX_MODE_MASK) 779 if (mask & ~ATI_REMOTE2_MAX_MODE_MASK)
777 return -EINVAL; 780 return -EINVAL;