]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/n_r3964.c
[BNX2]: Fix default WoL setting.
[linux-2.6-omap-h63xx.git] / drivers / char / n_r3964.c
index 65f2d3a96b85dd80e9400e9c730482596f009e9f..6b918b80f73e6af785eeb34fdefa27e75ca32780 100644 (file)
@@ -1071,8 +1071,6 @@ static ssize_t r3964_read(struct tty_struct *tty, struct file *file,
        struct r3964_client_info *pClient;
        struct r3964_message *pMsg;
        struct r3964_client_message theMsg;
-       DECLARE_WAITQUEUE(wait, current);
-
        int count;
 
        TRACE_L("read()");
@@ -1086,16 +1084,8 @@ static ssize_t r3964_read(struct tty_struct *tty, struct file *file,
                                return -EAGAIN;
                        }
                        /* block until there is a message: */
-                       add_wait_queue(&pInfo->read_wait, &wait);
-repeat:
-                       current->state = TASK_INTERRUPTIBLE;
-                       pMsg = remove_msg(pInfo, pClient);
-                       if (!pMsg && !signal_pending(current)) {
-                               schedule();
-                               goto repeat;
-                       }
-                       current->state = TASK_RUNNING;
-                       remove_wait_queue(&pInfo->read_wait, &wait);
+                       wait_event_interruptible(pInfo->read_wait,
+                                       (pMsg = remove_msg(pInfo, pClient)));
                }
 
                /* If we still haven't got a message, we must have been signalled */