Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit d38b1497 authored by Jean Delvare's avatar Jean Delvare Committed by Mark M. Hoffman
Browse files

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



While this can be fixed easily with the current code, I'd rather
rewrite the whole function in a way which is more obviously correct.

Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Cc: Justin Thiessen <jthiessen@penguincomputing.com>
Signed-off-by: default avatarMark M. Hoffman <mhoffman@lightlink.com>
parent 5dd34572
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment