aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/w1')
-rw-r--r--drivers/w1/slaves/w1_therm.c4
-rw-r--r--drivers/w1/w1.c6
2 files changed, 4 insertions, 6 deletions
diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
index 4318935678c5..112f4ec59035 100644
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -112,7 +112,7 @@ static struct w1_therm_family_converter w1_therm_families[] = {
112 112
113static inline int w1_DS18B20_convert_temp(u8 rom[9]) 113static inline int w1_DS18B20_convert_temp(u8 rom[9])
114{ 114{
115 int t = (rom[1] << 8) | rom[0]; 115 s16 t = (rom[1] << 8) | rom[0];
116 t /= 16; 116 t /= 16;
117 return t; 117 return t;
118} 118}
@@ -204,7 +204,7 @@ static ssize_t w1_therm_read_bin(struct kobject *kobj,
204 204
205 crc = w1_calc_crc8(rom, 8); 205 crc = w1_calc_crc8(rom, 8);
206 206
207 if (rom[8] == crc && rom[0]) 207 if (rom[8] == crc)
208 verdict = 1; 208 verdict = 1;
209 } 209 }
210 } 210 }
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index 070217322c9f..33e50310e9e0 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -869,11 +869,9 @@ void w1_search_process(struct w1_master *dev, u8 search_type)
869 w1_search_devices(dev, search_type, w1_slave_found); 869 w1_search_devices(dev, search_type, w1_slave_found);
870 870
871 list_for_each_entry_safe(sl, sln, &dev->slist, w1_slave_entry) { 871 list_for_each_entry_safe(sl, sln, &dev->slist, w1_slave_entry) {
872 if (!test_bit(W1_SLAVE_ACTIVE, (unsigned long *)&sl->flags) && !--sl->ttl) { 872 if (!test_bit(W1_SLAVE_ACTIVE, (unsigned long *)&sl->flags) && !--sl->ttl)
873 w1_slave_detach(sl); 873 w1_slave_detach(sl);
874 874 else if (test_bit(W1_SLAVE_ACTIVE, (unsigned long *)&sl->flags))
875 dev->slave_count--;
876 } else if (test_bit(W1_SLAVE_ACTIVE, (unsigned long *)&sl->flags))
877 sl->ttl = dev->slave_ttl; 875 sl->ttl = dev->slave_ttl;
878 } 876 }
879 877