aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/w1')
-rw-r--r--drivers/w1/slaves/w1_therm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
index 112f4ec59035..fb28acaeed6c 100644
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -92,6 +92,7 @@ struct w1_therm_family_converter
92 int (*convert)(u8 rom[9]); 92 int (*convert)(u8 rom[9]);
93}; 93};
94 94
95/* The return value is millidegrees Centigrade. */
95static inline int w1_DS18B20_convert_temp(u8 rom[9]); 96static inline int w1_DS18B20_convert_temp(u8 rom[9]);
96static inline int w1_DS18S20_convert_temp(u8 rom[9]); 97static inline int w1_DS18S20_convert_temp(u8 rom[9]);
97 98
@@ -113,7 +114,7 @@ static struct w1_therm_family_converter w1_therm_families[] = {
113static inline int w1_DS18B20_convert_temp(u8 rom[9]) 114static inline int w1_DS18B20_convert_temp(u8 rom[9])
114{ 115{
115 s16 t = (rom[1] << 8) | rom[0]; 116 s16 t = (rom[1] << 8) | rom[0];
116 t /= 16; 117 t = t*1000/16;
117 return t; 118 return t;
118} 119}
119 120