summaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/ati_remote2.c
diff options
context:
space:
mode:
authorJJ Ding <dgdunix@gmail.com>2011-11-09 10:20:14 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-11-09 21:23:26 -0800
commit76496e7a02e99d42844f4fffa145b81e513e7acd (patch)
tree33812cc8a9b250a95cf90c237c46ec6fc6fcf2ff /drivers/input/misc/ati_remote2.c
parent7cf801cfc0774b777aa6861cf4a43a90b112b1ed (diff)
downloadblackbird-op-linux-76496e7a02e99d42844f4fffa145b81e513e7acd.tar.gz
blackbird-op-linux-76496e7a02e99d42844f4fffa145b81e513e7acd.zip
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/ati_remote2.c')
-rw-r--r--drivers/input/misc/ati_remote2.c19
1 files changed, 11 insertions, 8 deletions
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,
const struct kernel_param *kp,
unsigned int max)
{
- unsigned long mask;
+ unsigned int mask;
int ret;
if (!val)
return -EINVAL;
- ret = strict_strtoul(val, 0, &mask);
+ ret = kstrtouint(val, 0, &mask);
if (ret)
return ret;
@@ -719,11 +719,12 @@ static ssize_t ati_remote2_store_channel_mask(struct device *dev,
struct usb_device *udev = to_usb_device(dev);
struct usb_interface *intf = usb_ifnum_to_if(udev, 0);
struct ati_remote2 *ar2 = usb_get_intfdata(intf);
- unsigned long mask;
+ unsigned int mask;
int r;
- if (strict_strtoul(buf, 0, &mask))
- return -EINVAL;
+ r = kstrtouint(buf, 0, &mask);
+ if (r)
+ return r;
if (mask & ~ATI_REMOTE2_MAX_CHANNEL_MASK)
return -EINVAL;
@@ -768,10 +769,12 @@ static ssize_t ati_remote2_store_mode_mask(struct device *dev,
struct usb_device *udev = to_usb_device(dev);
struct usb_interface *intf = usb_ifnum_to_if(udev, 0);
struct ati_remote2 *ar2 = usb_get_intfdata(intf);
- unsigned long mask;
+ unsigned int mask;
+ int err;
- if (strict_strtoul(buf, 0, &mask))
- return -EINVAL;
+ err = kstrtouint(buf, 0, &mask);
+ if (err)
+ return err;
if (mask & ~ATI_REMOTE2_MAX_MODE_MASK)
return -EINVAL;
OpenPOWER on IntegriCloud