瀏覽代碼

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>
Ding Xiang 7 年之前
父節點
當前提交
9d20bca54b
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      drivers/usb/misc/trancevibrator.c

+ 3 - 1
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)