[dahdi-commits] sruffell: linux/trunk r9471 - /linux/trunk/drivers/dahdi/wctdm24xxp/

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Thu Nov 4 11:41:07 CDT 2010


Author: sruffell
Date: Thu Nov  4 11:41:02 2010
New Revision: 9471

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9471
Log:
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 at digium.com>

Modified:
    linux/trunk/drivers/dahdi/wctdm24xxp/base.c
    linux/trunk/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
    linux/trunk/drivers/dahdi/wctdm24xxp/xhfc.c

Modified: linux/trunk/drivers/dahdi/wctdm24xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=9471&r1=9470&r2=9471
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wctdm24xxp/base.c Thu Nov  4 11:41:02 2010
@@ -2476,14 +2476,6 @@
 	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 @@
 	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 @@
 	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 @@
 	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))

Modified: linux/trunk/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wctdm24xxp/wctdm24xxp.h?view=diff&rev=9471&r1=9470&r2=9471
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm24xxp/wctdm24xxp.h (original)
+++ linux/trunk/drivers/dahdi/wctdm24xxp/wctdm24xxp.h Thu Nov  4 11:41:02 2010
@@ -285,7 +285,6 @@
 /* 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);
 

Modified: linux/trunk/drivers/dahdi/wctdm24xxp/xhfc.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wctdm24xxp/xhfc.c?view=diff&rev=9471&r1=9470&r2=9471
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm24xxp/xhfc.c (original)
+++ linux/trunk/drivers/dahdi/wctdm24xxp/xhfc.c Thu Nov  4 11:41:02 2010
@@ -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 @@
 	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 @@
 	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); */




More information about the dahdi-commits mailing list