Skip to content

Commit dcb7cb9

Browse files
Frans MeulenbroeksGuenter Roeck
Frans Meulenbroeks
authored and
Guenter Roeck
committed
hwmon: (ad7414) fix checkpatch issues
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 <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
1 parent e91aef2 commit dcb7cb9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/hwmon/ad7414.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ static ssize_t set_max_min(struct device *dev,
130130
struct ad7414_data *data = i2c_get_clientdata(client);
131131
int index = to_sensor_dev_attr(attr)->index;
132132
u8 reg = AD7414_REG_LIMIT[index];
133-
long temp = simple_strtol(buf, NULL, 10);
133+
long temp;
134+
int ret = kstrtol(buf, 10, &temp);
135+
136+
if (ret < 0)
137+
return ret;
134138

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

0 commit comments

Comments
 (0)