usb: misc: fix obsolete function
authorDing Xiang <dingxiang@cmss.chinamobile.com>
Thu, 30 Aug 2018 09:31:18 +0000 (17:31 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Sep 2018 18:06:48 +0000 (20:06 +0200)
simple_strtoul is obsolete, and use kstrtoint instead

Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/trancevibrator.c

index b3e1f55..ac357ce 100644 (file)
@@ -46,7 +46,9 @@ static ssize_t speed_store(struct device *dev, struct device_attribute *attr,
        struct trancevibrator *tv = usb_get_intfdata(intf);
        int temp, retval, old;
 
-       temp = simple_strtoul(buf, NULL, 10);
+       retval = kstrtoint(buf, 10, &temp);
+       if (retval)
+               return retval;
        if (temp > 255)
                temp = 255;
        else if (temp < 0)