From 55f6cb916cf69bc33d1a0f2dec2389acd12b422c Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Wed, 1 Dec 2010 16:59:20 +0000 Subject: wctdm24xxp: Replace interruptible_sleep_on() with msleep when delaying. There were several cases where interruptible_sleep_on() was being used as a ms timer, since the assumption is that the board will interrupt at even 1ms intervals. We can replace these cases with msleep directly to clarify that we're just waiting. Signed-off-by: Shaun Ruffell git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9501 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/wctdm24xxp/base.c | 10 ++++------ drivers/dahdi/wctdm24xxp/xhfc.c | 5 ++--- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'drivers/dahdi') diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c index 59622c8..e6628ae 100644 --- a/drivers/dahdi/wctdm24xxp/base.c +++ b/drivers/dahdi/wctdm24xxp/base.c @@ -3979,8 +3979,7 @@ static int wctdm_vpm_init(struct wctdm *wc) wctdm_vpm_out(wc,x,i,0x00); } - for (i=0;i<30;i++) - interruptible_sleep_on(&wc->regq); + msleep(30); /* Put in bypass mode */ for (i = 0 ; i < MAX_TDM_CHAN ; i++) { @@ -4215,8 +4214,7 @@ static int wctdm_identify_modules(struct wctdm *wc) spin_unlock_irqrestore(&wc->reglock, flags); /* Wait just a bit; this makes sure that cmd_dequeue is emitting SPI commands in the appropriate mode(s). */ - for (x = 0; x < 10; x++) - interruptible_sleep_on(&wc->regq); + msleep(20); /* Now that all the cards have been reset, we can stop checking them all if there aren't as many */ spin_lock_irqsave(&wc->reglock, flags); @@ -4271,6 +4269,7 @@ retry: "quad-span module\n", x + 1); } else { if ((wc->desc->ports != 24) && ((x & 0x3) == 1) && !wc->altcs[x]) { + spin_lock_irqsave(&wc->reglock, flags); wc->altcs[x] = 2; @@ -4282,8 +4281,7 @@ retry: wc->modtype[x] = MOD_TYPE_FXSINIT; spin_unlock_irqrestore(&wc->reglock, flags); - interruptible_sleep_on(&wc->regq); - interruptible_sleep_on(&wc->regq); + msleep(20); spin_lock_irqsave(&wc->reglock, flags); wc->modtype[x] = MOD_TYPE_FXS; diff --git a/drivers/dahdi/wctdm24xxp/xhfc.c b/drivers/dahdi/wctdm24xxp/xhfc.c index b65245f..afa4b4d 100644 --- a/drivers/dahdi/wctdm24xxp/xhfc.c +++ b/drivers/dahdi/wctdm24xxp/xhfc.c @@ -2627,7 +2627,7 @@ void b400m_post_init(struct b400m *b4) /* functions called from the wctdm code */ int wctdm_init_b400m(struct wctdm *wc, int card) { - int i, ret = 0; + int ret = 0; unsigned long flags; if (wc->modtype[card & 0xfc] == MOD_TYPE_QRV) @@ -2641,8 +2641,7 @@ int wctdm_init_b400m(struct wctdm *wc, int card) wc->modtype[card + 3] = MOD_TYPE_BRI; spin_unlock_irqrestore(&wc->reglock, flags); - for (i = 0; i < 10; i++) - interruptible_sleep_on(&wc->regq); + msleep(20); if (b400m_probe(wc, card) != 0) { spin_lock_irqsave(&wc->reglock, flags); -- cgit v1.2.3