]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/phonet/pep.c
net: fix sleeping for sk_wait_event()
[karo-tx-linux.git] / net / phonet / pep.c
index 850a86cde0b3f6eab5b7aa09f4e6ffa66ccd6ed6..8bad5624a27a9ffdcbf193c4c2f078b4b648b044 100644 (file)
@@ -1167,7 +1167,7 @@ disabled:
        /* Wait until flow control allows TX */
        done = atomic_read(&pn->tx_credits);
        while (!done) {
-               DEFINE_WAIT(wait);
+               DEFINE_WAIT_FUNC(wait, woken_wake_function);
 
                if (!timeo) {
                        err = -EAGAIN;
@@ -1178,10 +1178,9 @@ disabled:
                        goto out;
                }
 
-               prepare_to_wait(sk_sleep(sk), &wait,
-                               TASK_INTERRUPTIBLE);
-               done = sk_wait_event(sk, &timeo, atomic_read(&pn->tx_credits));
-               finish_wait(sk_sleep(sk), &wait);
+               add_wait_queue(sk_sleep(sk), &wait);
+               done = sk_wait_event(sk, &timeo, atomic_read(&pn->tx_credits), &wait);
+               remove_wait_queue(sk_sleep(sk), &wait);
 
                if (sk->sk_state != TCP_ESTABLISHED)
                        goto disabled;