Skip to content

Commit

Permalink
staging: line6: Convert simple_strtol to strict_strtol in toneport.c
Browse files Browse the repository at this point in the history
Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Shawn Bohrer authored and Greg Kroah-Hartman committed Dec 11, 2009
1 parent 63a4a8b commit bb950a1
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions drivers/staging/line6/toneport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit bb950a1

Please sign in to comment.