drivers/w1/w1.c: replace strict_strtol() with kstrtol()
authorJingoo Han <jg1.han@samsung.com>
Wed, 11 Sep 2013 21:26:03 +0000 (14:26 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Sep 2013 22:59:35 +0000 (15:59 -0700)
The usage of strict_strtol() is not preferred, because strict_strtol() is
obsolete.  Thus, kstrtol() should be used.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/w1/w1.c

index 22013ca2119ce415e407f48844225eb06d0d30f2..c7c64f18773d87d5f23e81ec90ba7d8bfaee504a 100644 (file)
@@ -234,9 +234,11 @@ static ssize_t w1_master_attribute_store_search(struct device * dev,
 {
        long tmp;
        struct w1_master *md = dev_to_w1_master(dev);
+       int ret;
 
-       if (strict_strtol(buf, 0, &tmp) == -EINVAL)
-               return -EINVAL;
+       ret = kstrtol(buf, 0, &tmp);
+       if (ret)
+               return ret;
 
        mutex_lock(&md->mutex);
        md->search_count = tmp;
@@ -266,9 +268,11 @@ static ssize_t w1_master_attribute_store_pullup(struct device *dev,
 {
        long tmp;
        struct w1_master *md = dev_to_w1_master(dev);
+       int ret;
 
-       if (strict_strtol(buf, 0, &tmp) == -EINVAL)
-               return -EINVAL;
+       ret = kstrtol(buf, 0, &tmp);
+       if (ret)
+               return ret;
 
        mutex_lock(&md->mutex);
        md->enable_pullup = tmp;