- spin_lock_irqsave(&q->sync_lock, flags);
- if (! q->sync_event_put) { /* echoback event has been received */
- spin_unlock_irqrestore(&q->sync_lock, flags);
- return 0;
- }
-
- /* wait for echo event */
- spin_unlock(&q->sync_lock);
- interruptible_sleep_on_timeout(&q->sync_sleep, HZ);
- spin_lock(&q->sync_lock);
- if (signal_pending(current)) {
+ wait_event_interruptible_timeout(q->sync_sleep, ! q->sync_event_put, HZ);
+ if (signal_pending(current))