[svn-commits] sruffell: branch linux/2.4 r9676 - in /linux/branches/2.4: drivers/dahdi/hpec...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jan 20 23:30:43 CST 2011


Author: sruffell
Date: Thu Jan 20 23:30:39 2011
New Revision: 9676

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9676
Log:
Remove mutex emulation

Using semaphores as mutexes was removed from the kernel in 4882720b267b.
Just use straight semaphores now.  'DECLARE_MUTEX()' -> 'DEFINE_SEMAPHORE()'
and 'init_MUTEX()' -> 'sema_init()'.

Signed-off-by: Shaun Ruffell <sruffell at digium.com>
LKML-Reference: <20100907125057.562399240 at linutronix.de>
Acked-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9464

Modified:
    linux/branches/2.4/drivers/dahdi/hpec/dahdi_echocan_hpec.c
    linux/branches/2.4/drivers/dahdi/voicebus/voicebus.c
    linux/branches/2.4/drivers/dahdi/wctc4xxp/base.c
    linux/branches/2.4/drivers/dahdi/wctdm24xxp/base.c
    linux/branches/2.4/drivers/dahdi/wctdm24xxp/xhfc.c
    linux/branches/2.4/drivers/dahdi/xpp/xbus-core.c
    linux/branches/2.4/drivers/dahdi/xpp/xpp_usb.c
    linux/branches/2.4/include/dahdi/kernel.h

Modified: linux/branches/2.4/drivers/dahdi/hpec/dahdi_echocan_hpec.c
URL: http://svnview.digium.com/svn/dahdi/linux/branches/2.4/drivers/dahdi/hpec/dahdi_echocan_hpec.c?view=diff&rev=9676&r1=9675&r2=9676
==============================================================================
--- linux/branches/2.4/drivers/dahdi/hpec/dahdi_echocan_hpec.c (original)
+++ linux/branches/2.4/drivers/dahdi/hpec/dahdi_echocan_hpec.c Thu Jan 20 23:30:39 2011
@@ -115,7 +115,7 @@
 	hpec_channel_update(pvt->hpec, isig, iref);
 }
 
-DECLARE_MUTEX(license_lock);
+DEFINE_SEMAPHORE(license_lock);
 
 static int echo_can_create(struct dahdi_chan *chan, struct dahdi_echocanparams *ecp,
 			   struct dahdi_echocanparam *p, struct dahdi_echocan_state **ec)

Modified: linux/branches/2.4/drivers/dahdi/voicebus/voicebus.c
URL: http://svnview.digium.com/svn/dahdi/linux/branches/2.4/drivers/dahdi/voicebus/voicebus.c?view=diff&rev=9676&r1=9675&r2=9676
==============================================================================
--- linux/branches/2.4/drivers/dahdi/voicebus/voicebus.c (original)
+++ linux/branches/2.4/drivers/dahdi/voicebus/voicebus.c Thu Jan 20 23:30:39 2011
@@ -1115,7 +1115,7 @@
  */
 void voicebus_stop(struct voicebus *vb)
 {
-	static DECLARE_MUTEX(stop);
+	static DEFINE_SEMAPHORE(stop);
 
 	down(&stop);
 

Modified: linux/branches/2.4/drivers/dahdi/wctc4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/branches/2.4/drivers/dahdi/wctc4xxp/base.c?view=diff&rev=9676&r1=9675&r2=9676
==============================================================================
--- linux/branches/2.4/drivers/dahdi/wctc4xxp/base.c (original)
+++ linux/branches/2.4/drivers/dahdi/wctc4xxp/base.c Thu Jan 20 23:30:39 2011
@@ -3443,7 +3443,7 @@
 		return -EIO;
 	}
 
-	init_MUTEX(&wc->chansem);
+	sema_init(&wc->chansem, 1);
 	spin_lock_init(&wc->reglock);
 	spin_lock_init(&wc->cmd_list_lock);
 	spin_lock_init(&wc->rx_list_lock);

Modified: linux/branches/2.4/drivers/dahdi/wctdm24xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/branches/2.4/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=9676&r1=9675&r2=9676
==============================================================================
--- linux/branches/2.4/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/branches/2.4/drivers/dahdi/wctdm24xxp/base.c Thu Jan 20 23:30:39 2011
@@ -207,7 +207,7 @@
 }
 
 struct wctdm *ifaces[WC_MAX_IFACES];
-DECLARE_MUTEX(ifacelock);
+DEFINE_SEMAPHORE(ifacelock);
 
 static void wctdm_release(struct wctdm *wc);
 
@@ -4921,7 +4921,7 @@
 
 	/* This is to insure that the analog span is given lowest priority */
 	wc->oldsync = -1;
-	init_MUTEX(&wc->syncsem);
+	sema_init(&wc->syncsem, 1);
 	INIT_LIST_HEAD(&wc->frame_list);
 	spin_lock_init(&wc->frame_list_lock);
 

Modified: linux/branches/2.4/drivers/dahdi/wctdm24xxp/xhfc.c
URL: http://svnview.digium.com/svn/dahdi/linux/branches/2.4/drivers/dahdi/wctdm24xxp/xhfc.c?view=diff&rev=9676&r1=9675&r2=9676
==============================================================================
--- linux/branches/2.4/drivers/dahdi/wctdm24xxp/xhfc.c (original)
+++ linux/branches/2.4/drivers/dahdi/wctdm24xxp/xhfc.c Thu Jan 20 23:30:39 2011
@@ -2576,8 +2576,8 @@
 	}
 
 	spin_lock_init(&b4->reglock);
-	init_MUTEX(&b4->regsem);
-	init_MUTEX(&b4->fifosem);
+	sema_init(&b4->regsem, 1);
+	sema_init(&b4->fifosem, 1);
 
 	for (x = 0; x < 4; x++) {
 		fasthdlc_init(&b4->spans[x].rxhdlc, FASTHDLC_MODE_16);

Modified: linux/branches/2.4/drivers/dahdi/xpp/xbus-core.c
URL: http://svnview.digium.com/svn/dahdi/linux/branches/2.4/drivers/dahdi/xpp/xbus-core.c?view=diff&rev=9676&r1=9675&r2=9676
==============================================================================
--- linux/branches/2.4/drivers/dahdi/xpp/xbus-core.c (original)
+++ linux/branches/2.4/drivers/dahdi/xpp/xbus-core.c Thu Jan 20 23:30:39 2011
@@ -1165,7 +1165,7 @@
 	INIT_LIST_HEAD(&worker->card_list);
 	init_waitqueue_head(&worker->wait_for_xpd_initialization);
 	worker->wq = NULL;
-	init_MUTEX(&xbus->worker.running_initialization);
+	sema_init(&xbus->worker.running_initialization, 1);
 }
 
 /*

Modified: linux/branches/2.4/drivers/dahdi/xpp/xpp_usb.c
URL: http://svnview.digium.com/svn/dahdi/linux/branches/2.4/drivers/dahdi/xpp/xpp_usb.c?view=diff&rev=9676&r1=9675&r2=9676
==============================================================================
--- linux/branches/2.4/drivers/dahdi/xpp/xpp_usb.c (original)
+++ linux/branches/2.4/drivers/dahdi/xpp/xpp_usb.c Thu Jan 20 23:30:39 2011
@@ -248,7 +248,7 @@
 
 
 /* prevent races between open() and disconnect() */
-static DECLARE_MUTEX (disconnect_sem);
+static DEFINE_SEMAPHORE(disconnect_sem);
 
 /*
  * AsteriskNow kernel has backported the "lean" callback from 2.6.20
@@ -690,7 +690,7 @@
 		retval = -ENOMEM;
 		goto probe_failed;
 	}
-	init_MUTEX (&xusb->sem);
+	sema_init(&xusb->sem, 1);
 	atomic_set(&xusb->pending_writes, 0);
 	atomic_set(&xusb->pending_reads, 0);
 	atomic_set(&xusb->pcm_tx_drops, 0);

Modified: linux/branches/2.4/include/dahdi/kernel.h
URL: http://svnview.digium.com/svn/dahdi/linux/branches/2.4/include/dahdi/kernel.h?view=diff&rev=9676&r1=9675&r2=9676
==============================================================================
--- linux/branches/2.4/include/dahdi/kernel.h (original)
+++ linux/branches/2.4/include/dahdi/kernel.h Thu Jan 20 23:30:39 2011
@@ -1261,6 +1261,11 @@
 #endif /* 2.6.26 */
 #endif /* 2.6.31 */
 
+#ifndef DEFINE_SEMAPHORE
+#define DEFINE_SEMAPHORE(name) \
+	struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1)
+#endif
+
 #ifndef DMA_BIT_MASK
 #define DMA_BIT_MASK(n)	(((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
 #endif




More information about the svn-commits mailing list