aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1/slaves/w1_therm.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-06-22 22:11:56 -0400
committerJeff Garzik <jeff@garzik.org>2006-06-22 22:11:56 -0400
commit71d530cd1b6d97094481002a04c77fea1c8e1c22 (patch)
treee786da7145d83c19a594adf76ed90d52c51058b1 /drivers/w1/slaves/w1_therm.c
parentd7a80dad2fe19a2b8c119c8e9cba605474a75a2b (diff)
parentd588fcbe5a7ba8bba2cebf7799ab2d573717a806 (diff)
Merge branch 'master' into upstream
Conflicts: drivers/scsi/libata-core.c drivers/scsi/libata-scsi.c include/linux/pci_ids.h
Diffstat (limited to 'drivers/w1/slaves/w1_therm.c')
-rw-r--r--drivers/w1/slaves/w1_therm.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
index 536d16d78de..5372cfcbd05 100644
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -29,7 +29,6 @@
29#include <linux/delay.h> 29#include <linux/delay.h>
30 30
31#include "../w1.h" 31#include "../w1.h"
32#include "../w1_io.h"
33#include "../w1_int.h" 32#include "../w1_int.h"
34#include "../w1_family.h" 33#include "../w1_family.h"
35 34
@@ -166,12 +165,7 @@ static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, si
166 u8 rom[9], crc, verdict; 165 u8 rom[9], crc, verdict;
167 int i, max_trying = 10; 166 int i, max_trying = 10;
168 167
169 atomic_inc(&sl->refcnt); 168 mutex_lock(&sl->master->mutex);
170 smp_mb__after_atomic_inc();
171 if (down_interruptible(&sl->master->mutex)) {
172 count = 0;
173 goto out_dec;
174 }
175 169
176 if (off > W1_SLAVE_DATA_SIZE) { 170 if (off > W1_SLAVE_DATA_SIZE) {
177 count = 0; 171 count = 0;
@@ -234,10 +228,7 @@ static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, si
234 228
235 count += sprintf(buf + count, "t=%d\n", w1_convert_temp(rom, sl->family->fid)); 229 count += sprintf(buf + count, "t=%d\n", w1_convert_temp(rom, sl->family->fid));
236out: 230out:
237 up(&dev->mutex); 231 mutex_unlock(&dev->mutex);
238out_dec:
239 smp_mb__before_atomic_inc();
240 atomic_dec(&sl->refcnt);
241 232
242 return count; 233 return count;
243} 234}