diff options
author | Frans Meulenbroeks <fransmeulenbroeks@gmail.com> | 2012-01-08 19:34:20 +0100 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2012-03-18 18:26:30 -0700 |
commit | 7b102ed66030a454eac1afce3af89eb3d03b0ce4 (patch) | |
tree | 864f56541714d3e2b17204f5f49012eab663a80d /drivers/hwmon/i5k_amb.c | |
parent | 600151b9de97bd580f9dc09199a10f0c2b65cb97 (diff) | |
download | talos-op-linux-7b102ed66030a454eac1afce3af89eb3d03b0ce4.tar.gz talos-op-linux-7b102ed66030a454eac1afce3af89eb3d03b0ce4.zip |
hwmon: (i5k_amb) fix checkpatch issues
fixed:
WARNING: simple_strtoul is obsolete, use kstrtoul instead
+ unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
WARNING: simple_strtoul is obsolete, use kstrtoul instead
+ unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
WARNING: simple_strtoul is obsolete, use kstrtoul instead
+ unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers/hwmon/i5k_amb.c')
-rw-r--r-- | drivers/hwmon/i5k_amb.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/hwmon/i5k_amb.c b/drivers/hwmon/i5k_amb.c index d22f241b6a67..a18882cc073d 100644 --- a/drivers/hwmon/i5k_amb.c +++ b/drivers/hwmon/i5k_amb.c @@ -159,8 +159,12 @@ static ssize_t store_amb_min(struct device *dev, { struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); struct i5k_amb_data *data = dev_get_drvdata(dev); - unsigned long temp = simple_strtoul(buf, NULL, 10) / 500; + unsigned long temp; + int ret = kstrtoul(buf, 10, &temp); + if (ret < 0) + return ret; + temp = temp / 500; if (temp > 255) temp = 255; @@ -175,8 +179,12 @@ static ssize_t store_amb_mid(struct device *dev, { struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); struct i5k_amb_data *data = dev_get_drvdata(dev); - unsigned long temp = simple_strtoul(buf, NULL, 10) / 500; + unsigned long temp; + int ret = kstrtoul(buf, 10, &temp); + if (ret < 0) + return ret; + temp = temp / 500; if (temp > 255) temp = 255; @@ -191,8 +199,12 @@ static ssize_t store_amb_max(struct device *dev, { struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); struct i5k_amb_data *data = dev_get_drvdata(dev); - unsigned long temp = simple_strtoul(buf, NULL, 10) / 500; + unsigned long temp; + int ret = kstrtoul(buf, 10, &temp); + if (ret < 0) + return ret; + temp = temp / 500; if (temp > 255) temp = 255; |