int nr = to_sensor_dev_attr(attr)->index; \
struct i2c_client *client = to_i2c_client(dev); \
struct lm80_data *data = i2c_get_clientdata(client); \
- long val = simple_strtol(buf, NULL, 10); \
+ long val; \
+ int err = kstrtol(buf, 10, &val); \
+ if (err < 0) \
+ return err; \
\
mutex_lock(&data->update_lock);\
data->value[nr] = IN_TO_REG(val); \
int nr = to_sensor_dev_attr(attr)->index;
struct i2c_client *client = to_i2c_client(dev);
struct lm80_data *data = i2c_get_clientdata(client);
- long val = simple_strtoul(buf, NULL, 10);
+ unsigned long val;
+ int err = kstrtoul(buf, 10, &val);
+ if (err < 0)
+ return err;
mutex_lock(&data->update_lock);
data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr]));
int nr = to_sensor_dev_attr(attr)->index;
struct i2c_client *client = to_i2c_client(dev);
struct lm80_data *data = i2c_get_clientdata(client);
- unsigned long min, val = simple_strtoul(buf, NULL, 10);
+ unsigned long min, val;
u8 reg;
+ int err = kstrtoul(buf, 10, &val);
+ if (err < 0)
+ return err;
/* Save fan_min */
mutex_lock(&data->update_lock);
{ \
struct i2c_client *client = to_i2c_client(dev); \
struct lm80_data *data = i2c_get_clientdata(client); \
- long val = simple_strtoul(buf, NULL, 10); \
+ long val; \
+ int err = kstrtol(buf, 10, &val); \
+ if (err < 0) \
+ return err; \
\
mutex_lock(&data->update_lock); \
data->value = TEMP_LIMIT_TO_REG(val); \