1
0
Fork 0

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>
hifive-unleashed-5.1
David Fries 2014-01-15 22:29:14 -06:00 committed by Greg Kroah-Hartman
parent 4210569876
commit af8c7237b0
1 changed files with 3 additions and 1 deletions

View File

@ -243,7 +243,9 @@ static ssize_t w1_master_attribute_store_search(struct device * dev,
mutex_lock(&md->mutex);
md->search_count = tmp;
mutex_unlock(&md->mutex);
wake_up_process(md->thread);
/* Only wake if it is going to be searching. */
if (tmp)
wake_up_process(md->thread);
return count;
}