Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next
[deliverable/linux.git] / drivers / misc / ds1682.c
index 6a672f9ef522c7fe2a477f3fcc7e1001abf5996d..b909fb30232adbdc3771c8b2154d906a23e7269c 100644 (file)
@@ -85,7 +85,6 @@ static ssize_t ds1682_store(struct device *dev, struct device_attribute *attr,
 {
        struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr);
        struct i2c_client *client = to_i2c_client(dev);
-       char *endp;
        u64 val;
        __le32 val_le;
        int rc;
@@ -93,8 +92,8 @@ static ssize_t ds1682_store(struct device *dev, struct device_attribute *attr,
        dev_dbg(dev, "ds1682_store() called on %s\n", attr->attr.name);
 
        /* Decode input */
-       val = simple_strtoull(buf, &endp, 0);
-       if (buf == endp) {
+       rc = kstrtoull(buf, 0, &val);
+       if (rc < 0) {
                dev_dbg(dev, "input string not a number\n");
                return -EINVAL;
        }
This page took 0.043726 seconds and 5 git commands to generate.