summaryrefslogtreecommitdiff
path: root/drivers/usb/misc/trancevibrator.c
diff options
context:
space:
mode:
authorDing Xiang <dingxiang@cmss.chinamobile.com>2018-08-30 12:31:18 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-10 21:06:48 +0300
commit9d20bca54b6a92dff75e85dce29b202847b48232 (patch)
treea94fe34bb9b70893aab899e266e8081084bd42a7 /drivers/usb/misc/trancevibrator.c
parent23feefda22392d44ee4101dfcf946bc87a6c74b3 (diff)
downloadlinux-9d20bca54b6a92dff75e85dce29b202847b48232.tar.xz
usb: misc: fix obsolete function
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>
Diffstat (limited to 'drivers/usb/misc/trancevibrator.c')
-rw-r--r--drivers/usb/misc/trancevibrator.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/misc/trancevibrator.c b/drivers/usb/misc/trancevibrator.c
index b3e1f553954a..ac357ce2d1a6 100644
--- a/drivers/usb/misc/trancevibrator.c
+++ b/drivers/usb/misc/trancevibrator.c
@@ -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)