aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2007-07-16 02:40:20 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-16 12:05:44 -0400
commit6defec139a0fb0fb36c41a441f8417360da81ea1 (patch)
tree6da7c2b84a9d6978850e33f918e3ec6e3cac3003 /drivers
parente0955e14f72dd1f561dc8b7c4434a253914ddfd4 (diff)
Char: n_r3964, use wait_event_interruptible
Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Cc: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/n_r3964.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/char/n_r3964.c b/drivers/char/n_r3964.c
index 14557a4822c0..6b918b80f73e 100644
--- a/drivers/char/n_r3964.c
+++ b/drivers/char/n_r3964.c
@@ -1071,8 +1071,6 @@ static ssize_t r3964_read(struct tty_struct *tty, struct file *file,
1071 struct r3964_client_info *pClient; 1071 struct r3964_client_info *pClient;
1072 struct r3964_message *pMsg; 1072 struct r3964_message *pMsg;
1073 struct r3964_client_message theMsg; 1073 struct r3964_client_message theMsg;
1074 DECLARE_WAITQUEUE(wait, current);
1075
1076 int count; 1074 int count;
1077 1075
1078 TRACE_L("read()"); 1076 TRACE_L("read()");
@@ -1086,16 +1084,8 @@ static ssize_t r3964_read(struct tty_struct *tty, struct file *file,
1086 return -EAGAIN; 1084 return -EAGAIN;
1087 } 1085 }
1088 /* block until there is a message: */ 1086 /* block until there is a message: */
1089 add_wait_queue(&pInfo->read_wait, &wait); 1087 wait_event_interruptible(pInfo->read_wait,
1090repeat: 1088 (pMsg = remove_msg(pInfo, pClient)));
1091 __set_current_state(TASK_INTERRUPTIBLE);
1092 pMsg = remove_msg(pInfo, pClient);
1093 if (!pMsg && !signal_pending(current)) {
1094 schedule();
1095 goto repeat;
1096 }
1097 __set_current_state(TASK_RUNNING);
1098 remove_wait_queue(&pInfo->read_wait, &wait);
1099 } 1089 }
1100 1090
1101 /* If we still haven't got a message, we must have been signalled */ 1091 /* If we still haven't got a message, we must have been signalled */