summaryrefslogtreecommitdiffstats
path: root/drivers/misc/lis3lv02d/lis3lv02d.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/lis3lv02d/lis3lv02d.c')
-rw-r--r--drivers/misc/lis3lv02d/lis3lv02d.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c
index 4cd4a3d2a76a..036effe9a795 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d.c
@@ -831,9 +831,11 @@ static ssize_t lis3lv02d_rate_set(struct device *dev,
{
struct lis3lv02d *lis3 = dev_get_drvdata(dev);
unsigned long rate;
+ int ret;
- if (strict_strtoul(buf, 0, &rate))
- return -EINVAL;
+ ret = kstrtoul(buf, 0, &rate);
+ if (ret)
+ return ret;
lis3lv02d_sysfs_poweron(lis3);
if (lis3lv02d_set_odr(lis3, rate))