Char: cyclades, remove sleep_on
convert to wait_* and completion Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
875b206b5f
commit
2c7fea9921
|
@ -947,7 +947,7 @@ do_softint(struct work_struct *work)
|
||||||
tty_wakeup(tty);
|
tty_wakeup(tty);
|
||||||
#ifdef Z_WAKE
|
#ifdef Z_WAKE
|
||||||
if (test_and_clear_bit(Cy_EVENT_SHUTDOWN_WAKEUP, &info->event))
|
if (test_and_clear_bit(Cy_EVENT_SHUTDOWN_WAKEUP, &info->event))
|
||||||
wake_up_interruptible(&info->shutdown_wait);
|
complete(&info->shutdown_wait);
|
||||||
#endif
|
#endif
|
||||||
} /* do_softint */
|
} /* do_softint */
|
||||||
|
|
||||||
|
@ -2324,9 +2324,8 @@ block_til_ready(struct tty_struct *tty, struct file *filp,
|
||||||
* until it's done, and then try again.
|
* until it's done, and then try again.
|
||||||
*/
|
*/
|
||||||
if (tty_hung_up_p(filp) || (info->flags & ASYNC_CLOSING)) {
|
if (tty_hung_up_p(filp) || (info->flags & ASYNC_CLOSING)) {
|
||||||
if (info->flags & ASYNC_CLOSING) {
|
wait_event_interruptible(info->close_wait,
|
||||||
interruptible_sleep_on(&info->close_wait);
|
!(info->flags & ASYNC_CLOSING));
|
||||||
}
|
|
||||||
return (info->flags & ASYNC_HUP_NOTIFY) ? -EAGAIN: -ERESTARTSYS;
|
return (info->flags & ASYNC_HUP_NOTIFY) ? -EAGAIN: -ERESTARTSYS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2597,8 +2596,8 @@ static int cy_open(struct tty_struct *tty, struct file *filp)
|
||||||
* If the port is the middle of closing, bail out now
|
* If the port is the middle of closing, bail out now
|
||||||
*/
|
*/
|
||||||
if (tty_hung_up_p(filp) || (info->flags & ASYNC_CLOSING)) {
|
if (tty_hung_up_p(filp) || (info->flags & ASYNC_CLOSING)) {
|
||||||
if (info->flags & ASYNC_CLOSING)
|
wait_event_interruptible(info->close_wait,
|
||||||
interruptible_sleep_on(&info->close_wait);
|
!(info->flags & ASYNC_CLOSING));
|
||||||
return (info->flags & ASYNC_HUP_NOTIFY) ? -EAGAIN: -ERESTARTSYS;
|
return (info->flags & ASYNC_HUP_NOTIFY) ? -EAGAIN: -ERESTARTSYS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2805,7 +2804,7 @@ static void cy_close(struct tty_struct *tty, struct file *filp)
|
||||||
"ttyC%d was %x\n", info->line, retval);
|
"ttyC%d was %x\n", info->line, retval);
|
||||||
}
|
}
|
||||||
CY_UNLOCK(info, flags);
|
CY_UNLOCK(info, flags);
|
||||||
interruptible_sleep_on(&info->shutdown_wait);
|
wait_for_completion_interruptible(&info->shutdown_wait);
|
||||||
CY_LOCK(info, flags);
|
CY_LOCK(info, flags);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -4091,32 +4090,20 @@ cy_ioctl(struct tty_struct *tty, struct file *file,
|
||||||
case TIOCMIWAIT:
|
case TIOCMIWAIT:
|
||||||
CY_LOCK(info, flags);
|
CY_LOCK(info, flags);
|
||||||
/* note the counters on entry */
|
/* note the counters on entry */
|
||||||
cprev = info->icount;
|
cnow = info->icount;
|
||||||
CY_UNLOCK(info, flags);
|
CY_UNLOCK(info, flags);
|
||||||
while (1) {
|
ret_val = wait_event_interruptible(info->delta_msr_wait, ({
|
||||||
interruptible_sleep_on(&info->delta_msr_wait);
|
cprev = cnow;
|
||||||
/* see if a signal did it */
|
|
||||||
if (signal_pending(current)) {
|
|
||||||
return -ERESTARTSYS;
|
|
||||||
}
|
|
||||||
|
|
||||||
CY_LOCK(info, flags);
|
CY_LOCK(info, flags);
|
||||||
cnow = info->icount; /* atomic copy */
|
cnow = info->icount; /* atomic copy */
|
||||||
CY_UNLOCK(info, flags);
|
CY_UNLOCK(info, flags);
|
||||||
|
|
||||||
if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr &&
|
((arg & TIOCM_RNG) && (cnow.rng != cprev.rng)) ||
|
||||||
cnow.dcd == cprev.dcd && cnow.cts == cprev.cts) {
|
((arg & TIOCM_DSR) && (cnow.dsr != cprev.dsr)) ||
|
||||||
return -EIO; /* no change => error */
|
((arg & TIOCM_CD) && (cnow.dcd != cprev.dcd)) ||
|
||||||
}
|
((arg & TIOCM_CTS) && (cnow.cts != cprev.cts));
|
||||||
if (((arg & TIOCM_RNG) && (cnow.rng != cprev.rng)) ||
|
}));
|
||||||
((arg & TIOCM_DSR) && (cnow.dsr != cprev.dsr)) ||
|
break;
|
||||||
((arg & TIOCM_CD) && (cnow.dcd != cprev.dcd)) ||
|
|
||||||
((arg & TIOCM_CTS) && (cnow.cts != cprev.cts))) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
cprev = cnow;
|
|
||||||
}
|
|
||||||
/* NOTREACHED */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
|
* Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
|
||||||
|
@ -4534,7 +4521,7 @@ static void __devinit cy_init_card(struct cyclades_card *cinfo)
|
||||||
INIT_WORK(&info->tqueue, do_softint);
|
INIT_WORK(&info->tqueue, do_softint);
|
||||||
init_waitqueue_head(&info->open_wait);
|
init_waitqueue_head(&info->open_wait);
|
||||||
init_waitqueue_head(&info->close_wait);
|
init_waitqueue_head(&info->close_wait);
|
||||||
init_waitqueue_head(&info->shutdown_wait);
|
init_completion(&info->shutdown_wait);
|
||||||
init_waitqueue_head(&info->delta_msr_wait);
|
init_waitqueue_head(&info->delta_msr_wait);
|
||||||
|
|
||||||
if (IS_CYC_Z(*cinfo)) {
|
if (IS_CYC_Z(*cinfo)) {
|
||||||
|
|
|
@ -588,7 +588,7 @@ struct cyclades_port {
|
||||||
struct work_struct tqueue;
|
struct work_struct tqueue;
|
||||||
wait_queue_head_t open_wait;
|
wait_queue_head_t open_wait;
|
||||||
wait_queue_head_t close_wait;
|
wait_queue_head_t close_wait;
|
||||||
wait_queue_head_t shutdown_wait;
|
struct completion shutdown_wait;
|
||||||
wait_queue_head_t delta_msr_wait;
|
wait_queue_head_t delta_msr_wait;
|
||||||
int throttle;
|
int throttle;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue