aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1/slaves/w1_ds2408.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/w1/slaves/w1_ds2408.c')
-rw-r--r--drivers/w1/slaves/w1_ds2408.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/w1/slaves/w1_ds2408.c b/drivers/w1/slaves/w1_ds2408.c
index 8e813eed0f0..441ad3a3b58 100644
--- a/drivers/w1/slaves/w1_ds2408.c
+++ b/drivers/w1/slaves/w1_ds2408.c
@@ -52,11 +52,11 @@ static int _read_reg(struct w1_slave *sl, u8 address, unsigned char* buf)
52 if (!buf) 52 if (!buf)
53 return -EINVAL; 53 return -EINVAL;
54 54
55 mutex_lock(&sl->master->mutex); 55 mutex_lock(&sl->master->bus_mutex);
56 dev_dbg(&sl->dev, "mutex locked"); 56 dev_dbg(&sl->dev, "mutex locked");
57 57
58 if (w1_reset_select_slave(sl)) { 58 if (w1_reset_select_slave(sl)) {
59 mutex_unlock(&sl->master->mutex); 59 mutex_unlock(&sl->master->bus_mutex);
60 return -EIO; 60 return -EIO;
61 } 61 }
62 62
@@ -66,7 +66,7 @@ static int _read_reg(struct w1_slave *sl, u8 address, unsigned char* buf)
66 w1_write_block(sl->master, wrbuf, 3); 66 w1_write_block(sl->master, wrbuf, 3);
67 *buf = w1_read_8(sl->master); 67 *buf = w1_read_8(sl->master);
68 68
69 mutex_unlock(&sl->master->mutex); 69 mutex_unlock(&sl->master->bus_mutex);
70 dev_dbg(&sl->dev, "mutex unlocked"); 70 dev_dbg(&sl->dev, "mutex unlocked");
71 return 1; 71 return 1;
72} 72}
@@ -165,7 +165,7 @@ static ssize_t w1_f29_write_output(
165 return -EFAULT; 165 return -EFAULT;
166 166
167 dev_dbg(&sl->dev, "locking mutex for write_output"); 167 dev_dbg(&sl->dev, "locking mutex for write_output");
168 mutex_lock(&sl->master->mutex); 168 mutex_lock(&sl->master->bus_mutex);
169 dev_dbg(&sl->dev, "mutex locked"); 169 dev_dbg(&sl->dev, "mutex locked");
170 170
171 if (w1_reset_select_slave(sl)) 171 if (w1_reset_select_slave(sl))
@@ -200,14 +200,14 @@ static ssize_t w1_f29_write_output(
200 /* read the result of the READ_PIO_REGS command */ 200 /* read the result of the READ_PIO_REGS command */
201 if (w1_read_8(sl->master) == *buf) { 201 if (w1_read_8(sl->master) == *buf) {
202 /* success! */ 202 /* success! */
203 mutex_unlock(&sl->master->mutex); 203 mutex_unlock(&sl->master->bus_mutex);
204 dev_dbg(&sl->dev, 204 dev_dbg(&sl->dev,
205 "mutex unlocked, retries:%d", retries); 205 "mutex unlocked, retries:%d", retries);
206 return 1; 206 return 1;
207 } 207 }
208 } 208 }
209error: 209error:
210 mutex_unlock(&sl->master->mutex); 210 mutex_unlock(&sl->master->bus_mutex);
211 dev_dbg(&sl->dev, "mutex unlocked in error, retries:%d", retries); 211 dev_dbg(&sl->dev, "mutex unlocked in error, retries:%d", retries);
212 212
213 return -EIO; 213 return -EIO;
@@ -228,7 +228,7 @@ static ssize_t w1_f29_write_activity(
228 if (count != 1 || off != 0) 228 if (count != 1 || off != 0)
229 return -EFAULT; 229 return -EFAULT;
230 230
231 mutex_lock(&sl->master->mutex); 231 mutex_lock(&sl->master->bus_mutex);
232 232
233 if (w1_reset_select_slave(sl)) 233 if (w1_reset_select_slave(sl))
234 goto error; 234 goto error;
@@ -236,7 +236,7 @@ static ssize_t w1_f29_write_activity(
236 while (retries--) { 236 while (retries--) {
237 w1_write_8(sl->master, W1_F29_FUNC_RESET_ACTIVITY_LATCHES); 237 w1_write_8(sl->master, W1_F29_FUNC_RESET_ACTIVITY_LATCHES);
238 if (w1_read_8(sl->master) == W1_F29_SUCCESS_CONFIRM_BYTE) { 238 if (w1_read_8(sl->master) == W1_F29_SUCCESS_CONFIRM_BYTE) {
239 mutex_unlock(&sl->master->mutex); 239 mutex_unlock(&sl->master->bus_mutex);
240 return 1; 240 return 1;
241 } 241 }
242 if (w1_reset_resume_command(sl->master)) 242 if (w1_reset_resume_command(sl->master))
@@ -244,7 +244,7 @@ static ssize_t w1_f29_write_activity(
244 } 244 }
245 245
246error: 246error:
247 mutex_unlock(&sl->master->mutex); 247 mutex_unlock(&sl->master->bus_mutex);
248 return -EIO; 248 return -EIO;
249} 249}
250 250
@@ -263,7 +263,7 @@ static ssize_t w1_f29_write_status_control(
263 if (count != 1 || off != 0) 263 if (count != 1 || off != 0)
264 return -EFAULT; 264 return -EFAULT;
265 265
266 mutex_lock(&sl->master->mutex); 266 mutex_lock(&sl->master->bus_mutex);
267 267
268 if (w1_reset_select_slave(sl)) 268 if (w1_reset_select_slave(sl))
269 goto error; 269 goto error;
@@ -285,12 +285,12 @@ static ssize_t w1_f29_write_status_control(
285 w1_write_block(sl->master, w1_buf, 3); 285 w1_write_block(sl->master, w1_buf, 3);
286 if (w1_read_8(sl->master) == *buf) { 286 if (w1_read_8(sl->master) == *buf) {
287 /* success! */ 287 /* success! */
288 mutex_unlock(&sl->master->mutex); 288 mutex_unlock(&sl->master->bus_mutex);
289 return 1; 289 return 1;
290 } 290 }
291 } 291 }
292error: 292error:
293 mutex_unlock(&sl->master->mutex); 293 mutex_unlock(&sl->master->bus_mutex);
294 294
295 return -EIO; 295 return -EIO;
296} 296}