Skip to content
Commit 724e8af8 authored by Paul Fertser's avatar Paul Fertser Committed by Guenter Roeck
Browse files

hwmon: (tmp421) fix rounding for negative values



Old code produces -24999 for 0b1110011100000000 input in standard format due to
always rounding up rather than "away from zero".

Use the common macro for division, unify and simplify the conversion code along
the way.

Fixes: 9410700b ("hwmon: Add driver for Texas Instruments TMP421/422/423 sensor chips")
Signed-off-by: default avatarPaul Fertser <fercerpav@gmail.com>
Link: https://lore.kernel.org/r/20210924093011.26083-3-fercerpav@gmail.com


Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 540effa7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment