Skip to contentSkip to conversation

hwmon: (it87) Fix VID reading on

PATCH In review Jean Delvare 1 participant 2 messages Oct 22, 2009 – Oct 23, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 hwmon: (it87) Fix VID reading on

Comparing apples to bananas doesn't seem right. Consistently use the chips enum for chip type comparisons, to avoid such bugs in the future.

The bug has been there since support for the IT8718F was added, so VID never worked for this chip nor for the similar IT8720F.

---
Stable team, this fix applies to 2.6.27 and 2.6.31, and everything in between if they are going to see one more stable release (I guess not.)

 drivers/hwmon/it87.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/hwmon/it87.c +2 -3
@@ -1028,12 +1028,11 @@ static int __init it87_find(unsigned sho
 		chip_type, *address, sio_data->revision);
 
 	/* Read GPIO config and VID value from LDN 7 (GPIO) */
-	if (chip_type != IT8705F_DEVID) {
+	if (sio_data->type != it87) {
 		int reg;
 
 		superio_select(GPIO);
-		if ((chip_type = it8718) ||
-		    (chip_type = it8720))
+		if (sio_data->type = it8718 || sio_data->type = it8720)
 			sio_data->vid_value = superio_inb(IT87_SIO_VID_REG);
 
 		reg = superio_inb(IT87_SIO_PINX2_REG);
Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#1 lore raw
Quoted 11 lines · Jean Delvare

Comparing apples to bananas doesn't seem right. Consistently use the chips enum for chip type comparisons, to avoid such bugs in the future.

The bug has been there since support for the IT8718F was added, so VID never worked for this chip nor for the similar IT8720F.

---
Stable team, this fix applies to 2.6.27 and 2.6.31, and everything in between if they are going to see one more stable release (I guess not.)

My bad, it won't apply to 2.6.27 because IT8720F support was added in 2.6.29. I'll send a separate patch for 2.6.27.

Quoted 23 lines
 drivers/hwmon/it87.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/hwmon/it87.c +2 -3
@@ -1028,12 +1028,11 @@ static int __init it87_find(unsigned sho
 		chip_type, *address, sio_data->revision);
 
 	/* Read GPIO config and VID value from LDN 7 (GPIO) */
-	if (chip_type != IT8705F_DEVID) {
+	if (sio_data->type != it87) {
 		int reg;
 
 		superio_select(GPIO);
-		if ((chip_type = it8718) ||
-		    (chip_type = it8720))
+		if (sio_data->type = it8718 || sio_data->type = it8720)
 			sio_data->vid_value = superio_inb(IT87_SIO_VID_REG);
 
 		reg = superio_inb(IT87_SIO_PINX2_REG);
Signature · 6 lines
Jean Delvare

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