#define TEMP_FROM_REG(val) ((val) * 1000)
-#define DIV_FROM_REG(val) ( 1 << (((val) >> 6) - 1))
+#define DIV_FROM_REG(val) (1 << (((val) >> 6) - 1))
/* Registers to be checked by adm1029_update_device() */
static const u8 ADM1029_REG_TEMP[] = {
struct i2c_client *client = to_i2c_client(dev);
struct adm1029_data *data = i2c_get_clientdata(client);
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
- long val = simple_strtol(buf, NULL, 10);
u8 reg;
+ long val;
+ int ret = kstrtol(buf, 10, &val);
+ if (ret < 0)
+ return ret;
mutex_lock(&data->update_lock);
}
/* Register sysfs hooks */
- if ((err = sysfs_create_group(&client->dev.kobj, &adm1029_group)))
+ err = sysfs_create_group(&client->dev.kobj, &adm1029_group);
+ if (err)
goto exit_free;
data->hwmon_dev = hwmon_device_register(&client->dev);