diff options
author | David Fries <David@Fries.net> | 2014-01-15 23:29:14 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-07 18:40:17 -0500 |
commit | af8c7237b082acefb996878a21a87017059b2c52 (patch) | |
tree | 18fb2bde4eba67f96d64261bda0854bcf2db3630 /drivers/w1 | |
parent | 421056987620fecb43c22c558e127085c406b7ba (diff) |
w1: Only wake up the search process if it is going to be searching
It's valid to set the search count to 0 to stop searching, so don't
wake up the search thread to not search.
Signed-off-by: David Fries <David@Fries.net>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/w1')
-rw-r--r-- | drivers/w1/w1.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index 67b6d5fb25bc..92766a9f8b4d 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c | |||
@@ -243,7 +243,9 @@ static ssize_t w1_master_attribute_store_search(struct device * dev, | |||
243 | mutex_lock(&md->mutex); | 243 | mutex_lock(&md->mutex); |
244 | md->search_count = tmp; | 244 | md->search_count = tmp; |
245 | mutex_unlock(&md->mutex); | 245 | mutex_unlock(&md->mutex); |
246 | wake_up_process(md->thread); | 246 | /* Only wake if it is going to be searching. */ |
247 | if (tmp) | ||
248 | wake_up_process(md->thread); | ||
247 | 249 | ||
248 | return count; | 250 | return count; |
249 | } | 251 | } |