Skip to content

Commit

Permalink
hwmon: (i5k_amb) fix checkpatch issues
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Frans Meulenbroeks authored and Guenter Roeck committed Mar 19, 2012
1 parent 600151b commit 7b102ed
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions drivers/hwmon/i5k_amb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand Down

0 comments on commit 7b102ed

Please sign in to comment.