summaryrefslogtreecommitdiff
path: root/drivers/w1/w1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/w1/w1.c')
-rw-r--r--drivers/w1/w1.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index aac03f151fe..730faa49d8d 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -813,21 +813,14 @@ int w1_process(void *data)
struct w1_master *dev = (struct w1_master *) data;
while (!kthread_should_stop() && !test_bit(W1_MASTER_NEED_EXIT, &dev->flags)) {
+ if (dev->search_count) {
+ mutex_lock(&dev->mutex);
+ w1_search_process(dev, W1_SEARCH);
+ mutex_unlock(&dev->mutex);
+ }
+
try_to_freeze();
msleep_interruptible(w1_timeout * 1000);
-
- if (kthread_should_stop() || test_bit(W1_MASTER_NEED_EXIT, &dev->flags))
- break;
-
- if (!dev->initialized)
- continue;
-
- if (dev->search_count == 0)
- continue;
-
- mutex_lock(&dev->mutex);
- w1_search_process(dev, W1_SEARCH);
- mutex_unlock(&dev->mutex);
}
atomic_dec(&dev->refcnt);