Commit b07d9452 authored by Stefan Hajnoczi's avatar Stefan Hajnoczi Committed by Greg Kroah-Hartman

staging: line6: replace deprecated strict_strtol() in toneport.c

The LED value is an int, so replace strict_strtol() with kstrtoint().
It's safe to pass in the actual variable instead of a local temporary
because strto*() doesn't write to the result unless the function returns
success.
Signed-off-by: default avatarStefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6a8ec876
...@@ -127,13 +127,11 @@ static ssize_t toneport_set_led_red(struct device *dev, ...@@ -127,13 +127,11 @@ static ssize_t toneport_set_led_red(struct device *dev,
const char *buf, size_t count) const char *buf, size_t count)
{ {
int retval; int retval;
long value;
retval = strict_strtol(buf, 10, &value); retval = kstrtoint(buf, 10, &led_red);
if (retval) if (retval)
return retval; return retval;
led_red = value;
toneport_update_led(dev); toneport_update_led(dev);
return count; return count;
} }
...@@ -143,13 +141,11 @@ static ssize_t toneport_set_led_green(struct device *dev, ...@@ -143,13 +141,11 @@ static ssize_t toneport_set_led_green(struct device *dev,
const char *buf, size_t count) const char *buf, size_t count)
{ {
int retval; int retval;
long value;
retval = strict_strtol(buf, 10, &value); retval = kstrtoint(buf, 10, &led_green);
if (retval) if (retval)
return retval; return retval;
led_green = value;
toneport_update_led(dev); toneport_update_led(dev);
return count; return count;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment