summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2010-11-04 16:41:02 +0000
committerShaun Ruffell <sruffell@digium.com>2010-11-04 16:41:02 +0000
commit254c020802926f14014b09e4d901fc317e561a4f (patch)
tree9f38f665ed5ce2257d02980bc39865ae6cc8b794 /drivers
parent4a972ffb2bf477c7014a99a18c9dce2fb0416c6b (diff)
wctdm24xxp: 'wait_just_a_bit()' -> 'msleep()'
If we're waiting for tens or hundreds of milliseconds we will just go to sleep instead of spinning. Signed-off-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9471 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dahdi/wctdm24xxp/base.c21
-rw-r--r--drivers/dahdi/wctdm24xxp/wctdm24xxp.h1
-rw-r--r--drivers/dahdi/wctdm24xxp/xhfc.c5
3 files changed, 8 insertions, 19 deletions
diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c
index 656054e..59622c8 100644
--- a/drivers/dahdi/wctdm24xxp/base.c
+++ b/drivers/dahdi/wctdm24xxp/base.c
@@ -2476,14 +2476,6 @@ static int wctdm_proslic_calibrate(struct wctdm *wc, int card)
return 0;
}
-void wait_just_a_bit(int foo)
-{
- long newjiffies;
- newjiffies = jiffies + foo;
- while (jiffies < newjiffies)
- ;
-}
-
/*********************************************************************
* Set the hwgain on the analog modules
*
@@ -2619,22 +2611,19 @@ static int wctdm_init_voicedaa(struct wctdm *wc, int card, int fast, int manual,
spin_lock_irqsave(&wc->reglock, flags);
wc->modtype[card] = MOD_TYPE_NONE;
spin_unlock_irqrestore(&wc->reglock, flags);
- /* Wait just a bit */
- wait_just_a_bit(HZ/10);
+ msleep(100);
spin_lock_irqsave(&wc->reglock, flags);
wc->modtype[card] = MOD_TYPE_FXO;
spin_unlock_irqrestore(&wc->reglock, flags);
- wait_just_a_bit(HZ/10);
+ msleep(100);
if (!sane && wctdm_voicedaa_insane(wc, card))
return -2;
/* Software reset */
wctdm_setreg(wc, card, 1, 0x80);
-
- /* Wait just a bit */
- wait_just_a_bit(HZ/10);
+ msleep(100);
/* Set On-hook speed, Ringer impedence, and ringer threshold */
reg16 |= (fxo_modes[_opermode].ohs << 6);
@@ -2671,7 +2660,7 @@ static int wctdm_init_voicedaa(struct wctdm *wc, int card, int fast, int manual,
newjiffies = jiffies;
newjiffies += 2 * HZ;
while ((jiffies < newjiffies) && !(wctdm_getreg(wc, card, 11) & 0xf0))
- wait_just_a_bit(HZ/10);
+ msleep(100);
if (!(wctdm_getreg(wc, card, 11) & 0xf0)) {
dev_notice(&wc->vb.pdev->dev, "VoiceDAA did not bring up ISO link properly!\n");
@@ -2730,7 +2719,7 @@ static int wctdm_init_proslic(struct wctdm *wc, int card, int fast, int manual,
wc->modtype[card] = MOD_TYPE_FXS;
spin_unlock_irqrestore(&wc->reglock, flags);
- wait_just_a_bit(HZ/10);
+ msleep(100);
/* Sanity check the ProSLIC */
if (!sane && wctdm_proslic_insane(wc, card))
diff --git a/drivers/dahdi/wctdm24xxp/wctdm24xxp.h b/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
index 70df96a..562761b 100644
--- a/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
+++ b/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
@@ -285,7 +285,6 @@ struct wctdm {
/* Atomic flag bits for checkflag field */
#define WCTDM_CHECK_TIMING 0
-void wait_just_a_bit(int foo);
int wctdm_getreg(struct wctdm *wc, int card, int addr);
int wctdm_setreg(struct wctdm *wc, int card, int addr, int val);
diff --git a/drivers/dahdi/wctdm24xxp/xhfc.c b/drivers/dahdi/wctdm24xxp/xhfc.c
index 65cdfb7..b65245f 100644
--- a/drivers/dahdi/wctdm24xxp/xhfc.c
+++ b/drivers/dahdi/wctdm24xxp/xhfc.c
@@ -24,6 +24,7 @@
#include <linux/pci.h>
#include <linux/ppp_defs.h>
#include <linux/delay.h>
+#include <linux/sched.h>
#define FAST_HDLC_NEED_TABLES
#include <dahdi/kernel.h>
@@ -785,7 +786,7 @@ static void hfc_reset(struct b400m *b4)
b400m_setreg(b4, R_CIRM, V_SRES);
flush_hw();
- wait_just_a_bit(HZ/10);
+ msleep(100);
b400m_setreg(b4, R_CIRM, 0x00);
flush_hw();
@@ -2711,7 +2712,7 @@ void wctdm_unload_b400m(struct wctdm *wc, int card)
if (b4) {
b4->inited = 0;
- wait_just_a_bit(HZ/10);
+ msleep(100);
/* TODO: wait for tdm24xx driver to unregister the spans */
/* do { ... } while(not_unregistered); */