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:
@@ -451,10 +451,10 @@ static ssize_t adxl34x_disable_store(struct device *dev,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct adxl34x *ac = dev_get_drvdata(dev);
|
||||
unsigned long val;
|
||||
unsigned int val;
|
||||
int error;
|
||||
|
||||
error = strict_strtoul(buf, 10, &val);
|
||||
error = kstrtouint(buf, 10, &val);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
@@ -540,10 +540,10 @@ static ssize_t adxl34x_rate_store(struct device *dev,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct adxl34x *ac = dev_get_drvdata(dev);
|
||||
unsigned long val;
|
||||
unsigned char val;
|
||||
int error;
|
||||
|
||||
error = strict_strtoul(buf, 10, &val);
|
||||
error = kstrtou8(buf, 10, &val);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
@@ -575,10 +575,10 @@ static ssize_t adxl34x_autosleep_store(struct device *dev,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct adxl34x *ac = dev_get_drvdata(dev);
|
||||
unsigned long val;
|
||||
unsigned int val;
|
||||
int error;
|
||||
|
||||
error = strict_strtoul(buf, 10, &val);
|
||||
error = kstrtouint(buf, 10, &val);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
@@ -622,13 +622,13 @@ static ssize_t adxl34x_write_store(struct device *dev,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct adxl34x *ac = dev_get_drvdata(dev);
|
||||
unsigned long val;
|
||||
unsigned int val;
|
||||
int error;
|
||||
|
||||
/*
|
||||
* This allows basic ADXL register write access for debug purposes.
|
||||
*/
|
||||
error = strict_strtoul(buf, 16, &val);
|
||||
error = kstrtouint(buf, 16, &val);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user