aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1/w1_therm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/w1/w1_therm.c')
-rw-r--r--drivers/w1/w1_therm.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/w1/w1_therm.c b/drivers/w1/w1_therm.c
index 2259f3d851ff..2ed0e0f48268 100644
--- a/drivers/w1/w1_therm.c
+++ b/drivers/w1/w1_therm.c
@@ -176,15 +176,10 @@ static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, si
176 crc = 0; 176 crc = 0;
177 177
178 while (max_trying--) { 178 while (max_trying--) {
179 if (!w1_reset_bus (dev)) { 179 if (!w1_reset_select_slave(sl)) {
180 int count = 0; 180 int count = 0;
181 u8 match[9] = {W1_MATCH_ROM, };
182 unsigned int tm = 750; 181 unsigned int tm = 750;
183 182
184 memcpy(&match[1], (u64 *) & sl->reg_num, 8);
185
186 w1_write_block(dev, match, 9);
187
188 w1_write_8(dev, W1_CONVERT_TEMP); 183 w1_write_8(dev, W1_CONVERT_TEMP);
189 184
190 while (tm) { 185 while (tm) {
@@ -193,8 +188,7 @@ static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, si
193 flush_signals(current); 188 flush_signals(current);
194 } 189 }
195 190
196 if (!w1_reset_bus (dev)) { 191 if (!w1_reset_select_slave(sl)) {
197 w1_write_block(dev, match, 9);
198 192
199 w1_write_8(dev, W1_READ_SCRATCHPAD); 193 w1_write_8(dev, W1_READ_SCRATCHPAD);
200 if ((count = w1_read_block(dev, rom, 9)) != 9) { 194 if ((count = w1_read_block(dev, rom, 9)) != 9) {
@@ -205,7 +199,6 @@ static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, si
205 199
206 if (rom[8] == crc && rom[0]) 200 if (rom[8] == crc && rom[0])
207 verdict = 1; 201 verdict = 1;
208
209 } 202 }
210 } 203 }
211 204