Skip to content

Commit

Permalink
staging: line6: replace deprecated strict_strtol() in toneport.c
Browse files Browse the repository at this point in the history
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: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Stefan Hajnoczi authored and Greg Kroah-Hartman committed Nov 13, 2012
1 parent 6a8ec87 commit b07d945
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/staging/line6/toneport.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,11 @@ static ssize_t toneport_set_led_red(struct device *dev,
const char *buf, size_t count)
{
int retval;
long value;

retval = strict_strtol(buf, 10, &value);
retval = kstrtoint(buf, 10, &led_red);
if (retval)
return retval;

led_red = value;
toneport_update_led(dev);
return count;
}
Expand All @@ -143,13 +141,11 @@ static ssize_t toneport_set_led_green(struct device *dev,
const char *buf, size_t count)
{
int retval;
long value;

retval = strict_strtol(buf, 10, &value);
retval = kstrtoint(buf, 10, &led_green);
if (retval)
return retval;

led_green = value;
toneport_update_led(dev);
return count;
}
Expand Down

0 comments on commit b07d945

Please sign in to comment.