Skip to contentSkip to conversation

hwmon: (ds1621) Update zbits after conversion rate change

PATCH In review [email protected] 2 participants 3 messages Aug 22, 2014 – Aug 27, 2014 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (ds1621) Update zbits after conversion rate change

From: Robert Coulson <[email protected]>

After the conversion rate is changed, the zbits are not updated, but should be, since they are used later in the set_temp function.

This issue was noticed and reported by Murat Ilsever.

---
 drivers/hwmon/ds1621.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/hwmon/ds1621.c +1 -0
index 872d767..b96d201 100644
@@ -309,6 +309,7 @@ static ssize_t set_convrate(struct device *dev, struct device_attribute *da,
 	data->conf |= (resol << DS1621_REG_CONFIG_RESOL_SHIFT);
 	i2c_smbus_write_byte_data(client, DS1621_REG_CONF, data->conf);
 	data->update_interval = ds1721_convrates[resol];
+	data->zbits = 7 - resol;
 	mutex_unlock(&data->update_lock);
 
 	return count;
Signature · 7 lines
1.7.3.1


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
maintainer
#1 lore raw
Quoted 6 lines · On 08/22/2014 12:28 PM, [email protected] wrote:

From: Robert Coulson <[email protected]>

After the conversion rate is changed, the zbits are not updated, but should be, since they are used later in the set_temp function.

This issue was noticed and reported by Murat Ilsever.

Hi Rob,

good catch. Can you add the reporter with a Reported-by: tag to give proper credit ?

Also, if possible, it would be great if you can add a Fixes: tag showing the commit causing the problem. Search for existing Fixes:
tags to see how it is done.

Thanks,
Guenter

Quoted 12 lines
---
  drivers/hwmon/ds1621.c |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
drivers/hwmon/ds1621.c +0 -0
index 872d767..b96d201 100644

drivers/hwmon/ds1621.c static ssize_t set_convrate(struct device *dev, struct device_attribute *da, · line 315

Quoted 7 lines
drivers/hwmon/ds1621.c +1 -0
@@ -309,6 +309,7 @@ static ssize_t set_convrate(struct device *dev, struct device_attribute *da,
  	data->conf |= (resol << DS1621_REG_CONFIG_RESOL_SHIFT);
  	i2c_smbus_write_byte_data(client, DS1621_REG_CONF, data->conf);
  	data->update_interval = ds1721_convrates[resol];
+	data->zbits = 7 - resol;
  	mutex_unlock(&data->update_lock);
 
  	return count;

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#2 lore raw
In reply to [email protected]

Good morning Guenter and thank you for taking the time to review this patch, I appreciate it.

Yes, I will add the Reported-by and Fixes lines, then resend the updated patch.

thanks again,

*** Rob.

Quoted 41 lines · Guenter Roeck
Quoted 7 lines · On 08/22/2014 12:28 PM, [email protected] wrote:

From: Robert Coulson <[email protected]>

After the conversion rate is changed, the zbits are not updated, but should be, since they are used later in the set_temp function.

This issue was noticed and reported by Murat Ilsever.

Hi Rob,

good catch. Can you add the reporter with a Reported-by: tag to give proper credit ?

Also, if possible, it would be great if you can add a Fixes: tag showing the commit causing the problem. Search for existing Fixes:
tags to see how it is done.

Thanks,
Guenter

Quoted 17 lines
---
  drivers/hwmon/ds1621.c |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
drivers/hwmon/ds1621.c +1 -0
index 872d767..b96d201 100644
@@ -309,6 +309,7 @@ static ssize_t set_convrate(struct device *dev,
 struct device_attribute *da,
        data->conf |= (resol << DS1621_REG_CONFIG_RESOL_SHIFT);
        i2c_smbus_write_byte_data(client, DS1621_REG_CONF, data->conf);
        data->update_interval = ds1721_convrates[resol];
+       data->zbits = 7 - resol;
        mutex_unlock(&data->update_lock);
 
Quoted 4 lines
Quoted 3 lines
        return count;

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors