summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@gmail.com>2012-11-11 12:24:44 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-13 21:17:40 (GMT)
commitb07d945227e4e62d93e26c694bf0e7b70978a7d6 (patch)
tree66908da1b6437424b8e08c94744605eec26fc8a2
parent6a8ec8769d4613a5fbd981bfb3e5925b29d4140d (diff)
downloadlinux-fsl-qoriq-b07d945227e4e62d93e26c694bf0e7b70978a7d6.tar.xz
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: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/line6/toneport.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/staging/line6/toneport.c b/drivers/staging/line6/toneport.c
index 31b624b..a529dd3 100644
--- a/drivers/staging/line6/toneport.c
+++ b/drivers/staging/line6/toneport.c
@@ -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;
}
@@ -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;
}