X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Fchar%2Fn_r3964.c;h=6b918b80f73e6af785eeb34fdefa27e75ca32780;hb=711924b1052a280bd2452c3babb9816e4a77c723;hp=fab1b7d42858ad5a258863a84b43cf12e150f500;hpb=5e07e1ccb0c0f25dd748ebe2ef83008c2229bf1c;p=linux-2.6-omap-h63xx.git diff --git a/drivers/char/n_r3964.c b/drivers/char/n_r3964.c index fab1b7d4285..6b918b80f73 100644 --- a/drivers/char/n_r3964.c +++ b/drivers/char/n_r3964.c @@ -1005,9 +1005,7 @@ static int r3964_open(struct tty_struct *tty) tty->disc_data = pInfo; tty->receive_room = 65536; - init_timer(&pInfo->tmr); - pInfo->tmr.data = (unsigned long)pInfo; - pInfo->tmr.function = on_timeout; + setup_timer(&pInfo->tmr, on_timeout, (unsigned long)pInfo); return 0; } @@ -1073,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()"); @@ -1088,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 */