mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-24 09:50:04 +00:00
staging: line6: Convert simple_strtol to strict_strtol in toneport.c
Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
63a4a8bad9
commit
bb950a169d
1 changed files with 16 additions and 4 deletions
|
@ -96,8 +96,14 @@ static ssize_t toneport_set_led_red(struct device *dev,
|
|||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
char *c;
|
||||
led_red = simple_strtol(buf, &c, 10);
|
||||
int retval;
|
||||
long value;
|
||||
|
||||
retval = strict_strtol(buf, 10, &value);
|
||||
if (retval)
|
||||
return retval;
|
||||
|
||||
led_red = value;
|
||||
toneport_update_led(dev);
|
||||
return count;
|
||||
}
|
||||
|
@ -106,8 +112,14 @@ static ssize_t toneport_set_led_green(struct device *dev,
|
|||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
char *c;
|
||||
led_green = simple_strtol(buf, &c, 10);
|
||||
int retval;
|
||||
long value;
|
||||
|
||||
retval = strict_strtol(buf, 10, &value);
|
||||
if (retval)
|
||||
return retval;
|
||||
|
||||
led_green = value;
|
||||
toneport_update_led(dev);
|
||||
return count;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue