Input: convert obsolete strict_strtox to kstrtox

With commit 67d0a07544 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>
This commit is contained in:
JJ Ding
2011-11-09 10:20:14 -08:00
committed by Dmitry Torokhov
parent 7cf801cfc0
commit 76496e7a02
15 changed files with 173 additions and 104 deletions

View File

@@ -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;