Skip to content

Commit d3d11fe

Browse files
jdelvaredavem330
authored andcommitted
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: aed93e0 ("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]>
1 parent b6c6aed commit d3d11fe

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/broadcom

1 file changed

+1
-1
lines changed

drivers/net/ethernet/broadcom/tg3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10757,7 +10757,7 @@ static ssize_t tg3_show_temp(struct device *dev,
1075710757
tg3_ape_scratchpad_read(tp, &temperature, attr->index,
1075810758
sizeof(temperature));
1075910759
spin_unlock_bh(&tp->lock);
10760-
return sprintf(buf, "%u\n", temperature);
10760+
return sprintf(buf, "%u\n", temperature * 1000);
1076110761
}
1076210762

1076310763

0 commit comments

Comments
 (0)