tg3: Fix temperature reporting

The temperature registers appear to report values in degrees Celsius
while the hwmon API mandates values to be exposed in millidegrees
Celsius. Do the conversion so that the values reported by "sensors"
are correct.

Fixes: aed93e0bf4 ("tg3: Add hwmon support for temperature")
Signed-off-by: Jean Delvare <[email protected]>
Cc: Prashant Sreedharan <[email protected]>
Cc: Michael Chan <[email protected]>
Cc: [email protected] [v3.6+]
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
Jean Delvare authored and David S. Miller committed 2015-09-01 15:03:59 -07:00
1 parent b6c6aedcbc
commit d3d11fe08c
1 file changed
+1 -1
+1 -1
View File
@@ -10757,7 +10757,7 @@ static ssize_t tg3_show_temp(struct device *dev,
tg3_ape_scratchpad_read(tp, &temperature, attr->index,
sizeof(temperature));
spin_unlock_bh(&tp->lock);
return sprintf(buf, "%u\n", temperature);
return sprintf(buf, "%u\n", temperature * 1000);
}