diff options
author | Shaun Ruffell <sruffell@digium.com> | 2011-06-02 20:03:52 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2011-06-02 20:03:52 +0000 |
commit | 3581fa8cce5665f22afe05e4345f933be0799cd6 (patch) | |
tree | fabb9c53bdb0c663eaccfa01e1b0d6d555f90849 /drivers/dahdi/wctdm24xxp | |
parent | 1a745ee73c974dc57f38338c48d141408310d49c (diff) |
wctdm24xxp: Shorten up some of the sleeps/waits.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9969 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wctdm24xxp')
-rw-r--r-- | drivers/dahdi/wctdm24xxp/base.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c index 21e4c31..62eadce 100644 --- a/drivers/dahdi/wctdm24xxp/base.c +++ b/drivers/dahdi/wctdm24xxp/base.c @@ -2335,7 +2335,7 @@ wctdm_proslic_insane(struct wctdm *wc, struct wctdm_module *const mod) static int wctdm_proslic_powerleak_test(struct wctdm *wc, struct wctdm_module *const mod) { - unsigned long origjiffies; + unsigned long start; unsigned char vbat; /* Turn off linefeed */ @@ -2344,16 +2344,15 @@ wctdm_proslic_powerleak_test(struct wctdm *wc, struct wctdm_module *const mod) /* Power down */ wctdm_setreg(wc, mod, 14, 0x10); - /* Wait for one second */ - origjiffies = jiffies; + start = jiffies; - /* TODO: Why is this sleep necessary. WIthout it, the first read + /* TODO: Why is this sleep necessary. Without it, the first read * comes back with a 0 value. */ msleep(20); while ((vbat = wctdm_getreg(wc, mod, 82)) > 0x6) { - if ((jiffies - origjiffies) >= (HZ/2)) - break;; + if (time_after(jiffies, start + HZ/4)) + break; } if (vbat < 0x06) { @@ -2361,7 +2360,7 @@ wctdm_proslic_powerleak_test(struct wctdm *wc, struct wctdm_module *const mod) "Excessive leakage detected on module %d: %d " "volts (%02x) after %d ms\n", mod->card, 376 * vbat / 1000, vbat, - (int)((jiffies - origjiffies) * 1000 / HZ)); + (int)((jiffies - start) * 1000 / HZ)); return -1; } else if (debug & DEBUG_CARD) { dev_info(&wc->vb.pdev->dev, @@ -2701,12 +2700,12 @@ wctdm_init_voicedaa(struct wctdm *wc, struct wctdm_module *mod, spin_lock_irqsave(&wc->reglock, flags); mod->type = NONE; spin_unlock_irqrestore(&wc->reglock, flags); - msleep(100); + msleep(20); spin_lock_irqsave(&wc->reglock, flags); mod->type = FXO; spin_unlock_irqrestore(&wc->reglock, flags); - msleep(100); + msleep(20); if (!sane && wctdm_voicedaa_insane(wc, mod)) return -2; @@ -2837,7 +2836,7 @@ wctdm_init_proslic(struct wctdm *wc, struct wctdm_module *const mod, mod->type = FXS; spin_unlock_irqrestore(&wc->reglock, flags); - msleep(100); + /* msleep(100); */ /* Sanity check the ProSLIC */ if (!sane && wctdm_proslic_insane(wc, mod)) @@ -4280,7 +4279,7 @@ static void wctdm_identify_modules(struct wctdm *wc) /* Wait just a bit; this makes sure that cmd_dequeue is emitting SPI * commands in the appropriate mode(s). */ - msleep(20); + udelay(2000); /* Now that all the cards have been reset, we can stop checking them * all if there aren't as many */ |