]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
hwmon: (lm85) Fix function RANGE_TO_REG()
authorJean Delvare <khali@linux-fr.org>
Mon, 23 Jun 2008 08:14:26 +0000 (10:14 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 24 Jun 2008 21:08:30 +0000 (14:08 -0700)
commit73377b7ebafbb69016a6cf4342b65c560a85342e
treec68d4c0149f827d9e379b3dc15dda91563452c03
parente5e3a8f78823da1e66b75f7bcc28626589fb650c
hwmon: (lm85) Fix function RANGE_TO_REG()

Function RANGE_TO_REG() is broken. For a requested range of 2000 (2
degrees C), it will return an index value of 15, i.e. 80.0 degrees C,
instead of the expected index value of 0. All other values are handled
properly, just 2000 isn't.

The bug was introduced back in November 2004 by this patch:
http://git.kernel.org/?p=linux/kernel/git/tglx/history.git;a=commit;h=1c28d80f1992240373099d863e4996cdd5d646d0

In Linus' kernel I decided to rewrite the whole function in a way
which was more obviously correct. But for -stable let's just do the
minimal fix.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/hwmon/lm85.c