[svn-commits] sruffell: linux/trunk r9547 - /linux/trunk/drivers/dahdi/dahdi-base.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Dec 21 16:09:21 UTC 2010


Author: sruffell
Date: Tue Dec 21 10:09:17 2010
New Revision: 9547

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9547
Log:
dahdi: Remove interruptible_sleep_on() calls for WINK/FLASH.

Makes it a little more clear what it is we're really waiting for.

Signed-off-by: Shaun Ruffell <sruffell at digium.com>
Acked-by: Russ Meyerreicks <rmeyerreicks at digium.com>

Modified:
    linux/trunk/drivers/dahdi/dahdi-base.c

Modified: linux/trunk/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi-base.c?view=diff&rev=9547&r1=9546&r2=9547
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Tue Dec 21 10:09:17 2010
@@ -5574,6 +5574,18 @@
 	}
 }
 
+static inline bool
+is_txstate(struct dahdi_chan *const chan, const int txstate)
+{
+	bool ret;
+	unsigned long flags;
+
+	spin_lock_irqsave(&chan->lock, flags);
+	ret = (txstate == chan->txstate);
+	spin_unlock_irqrestore(&chan->lock, flags);
+	return ret;
+}
+
 static int dahdi_chan_ioctl(struct file *file, unsigned int cmd, unsigned long data)
 {
 	struct dahdi_chan *const chan = chan_from_file(file);
@@ -5905,7 +5917,8 @@
 				spin_unlock_irqrestore(&chan->lock, flags);
 				if (file->f_flags & O_NONBLOCK)
 					return -EINPROGRESS;
-				interruptible_sleep_on(&chan->txstateq);
+				wait_event_interruptible(chan->txstateq,
+					is_txstate(chan, DAHDI_TXSIG_ONHOOK));
 				if (signal_pending(current))
 					return -ERESTARTSYS;
 				break;
@@ -5919,7 +5932,8 @@
 				spin_unlock_irqrestore(&chan->lock, flags);
 				if (file->f_flags & O_NONBLOCK)
 					return -EINPROGRESS;
-				interruptible_sleep_on(&chan->txstateq);
+				wait_event_interruptible(chan->txstateq,
+					is_txstate(chan, DAHDI_TXSIG_OFFHOOK));
 				if (signal_pending(current))
 					return -ERESTARTSYS;
 				break;




More information about the svn-commits mailing list