Skip to content

Commit

Permalink
HID: replace strict_strtoul() with kstrtoul()
Browse files Browse the repository at this point in the history
The usage of strict_strtoul() is not preferred, because
strict_strtoul() is obsolete. Thus, kstrtoul() should be
used.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Jingoo Han authored and Jiri Kosina committed Jul 23, 2013
1 parent bc197ee commit dfc450b
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion drivers/hid/hid-magicmouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ MODULE_PARM_DESC(emulate_scroll_wheel, "Emulate a scroll wheel");
static unsigned int scroll_speed = 32;
static int param_set_scroll_speed(const char *val, struct kernel_param *kp) {
unsigned long speed;
if (!val || strict_strtoul(val, 0, &speed) || speed > 63)
if (!val || kstrtoul(val, 0, &speed) || speed > 63)
return -EINVAL;
scroll_speed = speed;
return 0;
Expand Down
12 changes: 6 additions & 6 deletions drivers/hid/hid-ntrig.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ static ssize_t set_min_width(struct device *dev,

unsigned long val;

if (strict_strtoul(buf, 0, &val))
if (kstrtoul(buf, 0, &val))
return -EINVAL;

if (val > nd->sensor_physical_width)
Expand Down Expand Up @@ -272,7 +272,7 @@ static ssize_t set_min_height(struct device *dev,

unsigned long val;

if (strict_strtoul(buf, 0, &val))
if (kstrtoul(buf, 0, &val))
return -EINVAL;

if (val > nd->sensor_physical_height)
Expand Down Expand Up @@ -306,7 +306,7 @@ static ssize_t set_activate_slack(struct device *dev,

unsigned long val;

if (strict_strtoul(buf, 0, &val))
if (kstrtoul(buf, 0, &val))
return -EINVAL;

if (val > 0x7f)
Expand Down Expand Up @@ -341,7 +341,7 @@ static ssize_t set_activation_width(struct device *dev,

unsigned long val;

if (strict_strtoul(buf, 0, &val))
if (kstrtoul(buf, 0, &val))
return -EINVAL;

if (val > nd->sensor_physical_width)
Expand Down Expand Up @@ -377,7 +377,7 @@ static ssize_t set_activation_height(struct device *dev,

unsigned long val;

if (strict_strtoul(buf, 0, &val))
if (kstrtoul(buf, 0, &val))
return -EINVAL;

if (val > nd->sensor_physical_height)
Expand Down Expand Up @@ -411,7 +411,7 @@ static ssize_t set_deactivate_slack(struct device *dev,

unsigned long val;

if (strict_strtoul(buf, 0, &val))
if (kstrtoul(buf, 0, &val))
return -EINVAL;

/*
Expand Down
6 changes: 3 additions & 3 deletions drivers/hid/hid-roccat-arvo.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static ssize_t arvo_sysfs_set_mode_key(struct device *dev,
unsigned long state;
int retval;

retval = strict_strtoul(buf, 10, &state);
retval = kstrtoul(buf, 10, &state);
if (retval)
return retval;

Expand Down Expand Up @@ -107,7 +107,7 @@ static ssize_t arvo_sysfs_set_key_mask(struct device *dev,
unsigned long key_mask;
int retval;

retval = strict_strtoul(buf, 10, &key_mask);
retval = kstrtoul(buf, 10, &key_mask);
if (retval)
return retval;

Expand Down Expand Up @@ -159,7 +159,7 @@ static ssize_t arvo_sysfs_set_actual_profile(struct device *dev,
unsigned long profile;
int retval;

retval = strict_strtoul(buf, 10, &profile);
retval = kstrtoul(buf, 10, &profile);
if (retval)
return retval;

Expand Down
2 changes: 1 addition & 1 deletion drivers/hid/hid-roccat-isku.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static ssize_t isku_sysfs_set_actual_profile(struct device *dev,
isku = hid_get_drvdata(dev_get_drvdata(dev));
usb_dev = interface_to_usbdev(to_usb_interface(dev));

retval = strict_strtoul(buf, 10, &profile);
retval = kstrtoul(buf, 10, &profile);
if (retval)
return retval;

Expand Down
4 changes: 2 additions & 2 deletions drivers/hid/hid-roccat-kone.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ static ssize_t kone_sysfs_set_tcu(struct device *dev,
kone = hid_get_drvdata(dev_get_drvdata(dev));
usb_dev = interface_to_usbdev(to_usb_interface(dev));

retval = strict_strtoul(buf, 10, &state);
retval = kstrtoul(buf, 10, &state);
if (retval)
return retval;

Expand Down Expand Up @@ -545,7 +545,7 @@ static ssize_t kone_sysfs_set_startup_profile(struct device *dev,
kone = hid_get_drvdata(dev_get_drvdata(dev));
usb_dev = interface_to_usbdev(to_usb_interface(dev));

retval = strict_strtoul(buf, 10, &new_startup_profile);
retval = kstrtoul(buf, 10, &new_startup_profile);
if (retval)
return retval;

Expand Down
2 changes: 1 addition & 1 deletion drivers/hid/hid-roccat-koneplus.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ static ssize_t koneplus_sysfs_set_actual_profile(struct device *dev,
koneplus = hid_get_drvdata(dev_get_drvdata(dev));
usb_dev = interface_to_usbdev(to_usb_interface(dev));

retval = strict_strtoul(buf, 10, &profile);
retval = kstrtoul(buf, 10, &profile);
if (retval)
return retval;

Expand Down
2 changes: 1 addition & 1 deletion drivers/hid/hid-roccat-kovaplus.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ static ssize_t kovaplus_sysfs_set_actual_profile(struct device *dev,
kovaplus = hid_get_drvdata(dev_get_drvdata(dev));
usb_dev = interface_to_usbdev(to_usb_interface(dev));

retval = strict_strtoul(buf, 10, &profile);
retval = kstrtoul(buf, 10, &profile);
if (retval)
return retval;

Expand Down

0 comments on commit dfc450b

Please sign in to comment.