dahdi: Initialize chan->waitq once at registration time.

This is instead of initializing the waitq each time the channel is
opened or closed.

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@9549 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
Shaun Ruffell 2010-12-21 16:09:27 +00:00
parent 2765186d03
commit 9496527004

View File

@ -1288,7 +1288,6 @@ static void close_channel(struct dahdi_chan *chan)
chan->pulsecount = 0;
chan->pulsetimer = 0;
chan->ringdebtimer = 0;
init_waitqueue_head(&chan->waitq);
chan->txdialbuf[0] = '\0';
chan->digitmode = DIGIT_MODE_DTMF;
chan->dialing = 0;
@ -1564,6 +1563,7 @@ static int dahdi_chan_reg(struct dahdi_chan *chan)
might_sleep();
spin_lock_init(&chan->lock);
init_waitqueue_head(&chan->waitq);
if (!chan->master)
chan->master = chan;
if (!chan->readchunk)
@ -2596,8 +2596,6 @@ static int initialize_channel(struct dahdi_chan *chan)
chan->itimerset = chan->itimer = chan->otimer = 0;
chan->ringdebtimer = 0;
init_waitqueue_head(&chan->waitq);
/* Reset conferences */
reset_conf(chan);