Skip to contentSkip to conversation

adm1026: allow 1 as a valid divider value

PATCH Applied Gabriele Gorla 2 participants 2 messages Dec 1, 2010 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 adm1026: allow 1 as a valid divider value

Allow 1 as a valid div value as specified in the adm1026 datasheet.

Signed-off-by Gabriele Gorla <gorlik at penguintown.net>

---

drivers/hwmon/adm1026.c +0 -3
diff -r -U 5 linux-source-2.6.26_orig/drivers/hwmon/adm1026.c linux-source-2.6.26/drivers/hwmon/adm1026.c
@@ -922,13 +922,10 @@
 	struct adm1026_data *data = i2c_get_clientdata(client);
 	int val, orig_div, new_div, shift;
 
 	val = simple_strtol(buf, NULL, 10);
 	new_div = DIV_TO_REG(val);
-	if (new_div = 0) {
-		return -EINVAL;
-	}
 	mutex_lock(&data->update_lock);
 	orig_div = data->fan_div[nr];
 	data->fan_div[nr] = DIV_FROM_REG(new_div);
 
 	if (nr < 4) { /* 0 <= nr < 4 */

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

Applied
#1 lore raw

Hi Gabriele,

Quoted 12 lines · Gabriele Gorla

Allow 1 as a valid div value as specified in the adm1026 datasheet.

Signed-off-by Gabriele Gorla <gorlik at penguintown.net>

---

diff -r -U 5 linux-source-2.6.26_orig/drivers/hwmon/adm1026.c linux-source-2.6.26/drivers/hwmon/adm1026.c

drivers/hwmon/adm1026.c +0 -0
@@ -922,13 +922,10 @@
 	struct adm1026_data *data = i2c_get_clientdata(client);
 	int val, orig_div, new_div, shift;
 

drivers/hwmon/adm1026.c line 931

Quoted 10 lines
drivers/hwmon/adm1026.c +0 -3
 	val = simple_strtol(buf, NULL, 10);
 	new_div = DIV_TO_REG(val);
-	if (new_div = 0) {
-		return -EINVAL;
-	}
 	mutex_lock(&data->update_lock);
 	orig_div = data->fan_div[nr];
 	data->fan_div[nr] = DIV_FROM_REG(new_div);
 
 	if (nr < 4) { /* 0 <= nr < 4 */

Applied, thanks.

Signature · 6 lines
Jean Delvare

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