staging: line6: replace deprecated strict_strtol() in toneport.c
authorStefan Hajnoczi <stefanha@gmail.com>
Sun, 11 Nov 2012 12:24:44 +0000 (13:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2012 21:17:40 +0000 (13:17 -0800)
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>
drivers/staging/line6/toneport.c

index 31b624b63425bfff9c244f667f7442436f36e538..a529dd3d604e7b69a9254fb395dfb8f46c4654dd 100644 (file)
@@ -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;
 }