[PATCH 2.6] Fix voltage rounding in asb100

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Greg,

This one line patch fixes voltage rounding in the asb100 chip driver.
It's very similar to a patch I submitted for the lm80 a few days ago.

It applies cleanly on top of 2.6.5-mm5.

Thanks.

--- linux-2.6.5-mm5/drivers/i2c/chips/asb100.c.orig	2004-04-13 09:57:04.000000000 +0200
+++ linux-2.6.5-mm5/drivers/i2c/chips/asb100.c	2004-04-13 10:35:07.000000000 +0200
@@ -124,7 +124,7 @@
 static u8 IN_TO_REG(unsigned val)
 {
 	unsigned nval = SENSORS_LIMIT(val, ASB100_IN_MIN, ASB100_IN_MAX);
-	return nval / 16;
+	return (nval + 8) / 16;
 }
 
 static unsigned IN_FROM_REG(u8 reg)


-- 
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/



[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux