@@ -400,7 +400,7 @@ static int max3110_main_thread(void *_max)
do {
wait_event_interruptible(*wq,
max->flags || kthread_should_stop());
- set_bit(0, &max->mthread_up);
+ test_and_set_bit(0, &max->mthread_up);
if (use_irq && test_bit(M3110_IRQ_PENDING, &max->flags)) {
max3110_con_receive(max);
@@ -418,7 +418,7 @@ static int max3110_main_thread(void *_max)
transmit_char(max);
clear_bit(M3110_UART_TX_NEED, &max->flags);
}
- clear_bit(0, &max->mthread_up);
+ test_and_clear_bit(0, &max->mthread_up);
} while (!kthread_should_stop());
return ret;