diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-15 17:31:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-15 17:31:28 -0500 |
commit | 3e9f4df0eac70842fbe329968c88a770794ff06b (patch) | |
tree | 5b07d9b6e0e13edd5feb5564fec7a5a339e2ad5a | |
parent | 2439f9766d31eb17584c0e89351a1ec8d1c1d507 (diff) | |
parent | aef17ca1271948ee57cc39b2493d31110cc42625 (diff) |
Merge tag 'hwmon-for-linus-v4.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon fix from Guenter Roeck:
"Fix bad temperature display on Ryzen/Threadripper"
* tag 'hwmon-for-linus-v4.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
hwmon: (k10temp) Only apply temperature offset if result is positive
-rw-r--r-- | drivers/hwmon/k10temp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c index 30303632fbb7..051a72eecb24 100644 --- a/drivers/hwmon/k10temp.c +++ b/drivers/hwmon/k10temp.c | |||
@@ -129,7 +129,10 @@ static ssize_t temp1_input_show(struct device *dev, | |||
129 | 129 | ||
130 | data->read_tempreg(data->pdev, ®val); | 130 | data->read_tempreg(data->pdev, ®val); |
131 | temp = (regval >> 21) * 125; | 131 | temp = (regval >> 21) * 125; |
132 | temp -= data->temp_offset; | 132 | if (temp > data->temp_offset) |
133 | temp -= data->temp_offset; | ||
134 | else | ||
135 | temp = 0; | ||
133 | 136 | ||
134 | return sprintf(buf, "%u\n", temp); | 137 | return sprintf(buf, "%u\n", temp); |
135 | } | 138 | } |