dahdi: Remove interruptible_sleep_on() calls for WINK/FLASH.
Makes it a little more clear what it is we're really waiting for. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Russ Meyerreicks <rmeyerreicks@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9547 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
parent
492315c255
commit
74fff81da4
@ -5574,6 +5574,18 @@ static void set_echocan_fax_mode(struct dahdi_chan *chan, unsigned int channo, c
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool
|
||||
is_txstate(struct dahdi_chan *const chan, const int txstate)
|
||||
{
|
||||
bool ret;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&chan->lock, flags);
|
||||
ret = (txstate == chan->txstate);
|
||||
spin_unlock_irqrestore(&chan->lock, flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int dahdi_chan_ioctl(struct file *file, unsigned int cmd, unsigned long data)
|
||||
{
|
||||
struct dahdi_chan *const chan = chan_from_file(file);
|
||||
@ -5905,7 +5917,8 @@ static int dahdi_chan_ioctl(struct file *file, unsigned int cmd, unsigned long d
|
||||
spin_unlock_irqrestore(&chan->lock, flags);
|
||||
if (file->f_flags & O_NONBLOCK)
|
||||
return -EINPROGRESS;
|
||||
interruptible_sleep_on(&chan->txstateq);
|
||||
wait_event_interruptible(chan->txstateq,
|
||||
is_txstate(chan, DAHDI_TXSIG_ONHOOK));
|
||||
if (signal_pending(current))
|
||||
return -ERESTARTSYS;
|
||||
break;
|
||||
@ -5919,7 +5932,8 @@ static int dahdi_chan_ioctl(struct file *file, unsigned int cmd, unsigned long d
|
||||
spin_unlock_irqrestore(&chan->lock, flags);
|
||||
if (file->f_flags & O_NONBLOCK)
|
||||
return -EINPROGRESS;
|
||||
interruptible_sleep_on(&chan->txstateq);
|
||||
wait_event_interruptible(chan->txstateq,
|
||||
is_txstate(chan, DAHDI_TXSIG_OFFHOOK));
|
||||
if (signal_pending(current))
|
||||
return -ERESTARTSYS;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user