Only tachometer and alarm status registers are modified by the chip. All other registers only need to be read only once, and reading them repeatedly does not add any value. Cc: Jean-Francois Dagenais <jeff.dagenais@xxxxxxxxx> Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx> --- drivers/hwmon/max6650.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c index 301184172ab1..7c8b1b8ededc 100644 --- a/drivers/hwmon/max6650.c +++ b/drivers/hwmon/max6650.c @@ -176,17 +176,10 @@ static struct max6650_data *max6650_update_device(struct device *dev) mutex_lock(&data->update_lock); if (time_after(jiffies, data->last_updated + HZ) || !data->valid) { - data->speed = i2c_smbus_read_byte_data(client, - MAX6650_REG_SPEED); - data->config = i2c_smbus_read_byte_data(client, - MAX6650_REG_CONFIG); for (i = 0; i < data->nr_fans; i++) { data->tach[i] = i2c_smbus_read_byte_data(client, tach_reg[i]); } - data->count = i2c_smbus_read_byte_data(client, - MAX6650_REG_COUNT); - data->dac = i2c_smbus_read_byte_data(client, MAX6650_REG_DAC); /* * Alarms are cleared on read in case the condition that @@ -435,8 +428,22 @@ static int max6650_init_client(struct max6650_data *data, dev_err(dev, "Config write error, aborting.\n"); return err; } - data->config = reg; + + reg = i2c_smbus_read_byte_data(client, MAX6650_REG_SPEED); + if (reg < 0) { + dev_err(dev, "Failed to read speed register, aborting.\n"); + return reg; + } + data->speed = reg; + + reg = i2c_smbus_read_byte_data(client, MAX6650_REG_DAC); + if (reg < 0) { + dev_err(dev, "Failed to read DAC register, aborting.\n"); + return reg; + } + data->dac = reg; + reg = i2c_smbus_read_byte_data(client, MAX6650_REG_COUNT); if (reg < 0) { dev_err(dev, "Failed to read count register, aborting.\n"); -- 2.7.4