Skip to content

Commit

Permalink
hwmon: (ad7414) fix checkpatch issues
Browse files Browse the repository at this point in the history
fixed:
WARNING: simple_strtol is obsolete, use kstrtol instead
#133: FILE: ad7414.c:133:
+	long temp = simple_strtol(buf, NULL, 10);

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.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 e91aef2 commit dcb7cb9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/hwmon/ad7414.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ static ssize_t set_max_min(struct device *dev,
struct ad7414_data *data = i2c_get_clientdata(client);
int index = to_sensor_dev_attr(attr)->index;
u8 reg = AD7414_REG_LIMIT[index];
long temp = simple_strtol(buf, NULL, 10);
long temp;
int ret = kstrtol(buf, 10, &temp);

if (ret < 0)
return ret;

temp = SENSORS_LIMIT(temp, -40000, 85000);
temp = (temp + (temp < 0 ? -500 : 500)) / 1000;
Expand Down

0 comments on commit dcb7cb9

Please sign in to comment.