[PATCH 3/3] net: wireless: bcm43xx: big_buffer_sem semaphore to mutex

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-Off-By: Daniel Walker <[email protected]>

---
 drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c |   30 ++++++++++++-------------
 1 file changed, 15 insertions(+), 15 deletions(-)

Index: linux-2.6.23/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
===================================================================
--- linux-2.6.23.orig/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
+++ linux-2.6.23/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
@@ -43,7 +43,7 @@
 
 static struct bcm43xx_debugfs fs;
 static char really_big_buffer[REALLY_BIG_BUFFER_SIZE];
-static DECLARE_MUTEX(big_buffer_sem);
+static DEFINE_MUTEX(big_buffer_mutex);
 
 
 static ssize_t write_file_dummy(struct file *file, const char __user *buf,
@@ -75,7 +75,7 @@ static ssize_t devinfo_read_file(struct 
 	u16 tmp16;
 	int i;
 
-	down(&big_buffer_sem);
+	mutex_lock(&big_buffer_mutex);
 
 	mutex_lock(&bcm->mutex);
 	spin_lock_irqsave(&bcm->irq_lock, flags);
@@ -125,7 +125,7 @@ out:
 	spin_unlock_irqrestore(&bcm->irq_lock, flags);
 	mutex_unlock(&bcm->mutex);
 	res = simple_read_from_buffer(userbuf, count, ppos, buf, pos);
-	up(&big_buffer_sem);
+	mutex_unlock(&big_buffer_mutex);
 	return res;
 }
 
@@ -138,14 +138,14 @@ static ssize_t drvinfo_read_file(struct 
 	size_t pos = 0;
 	ssize_t res;
 
-	down(&big_buffer_sem);
+	mutex_lock(&big_buffer_mutex);
 
 	/* This is where the information is written to the "driver" file */
 	fappend(KBUILD_MODNAME " driver\n");
 	fappend("Compiled at: %s %s\n", __DATE__, __TIME__);
 
 	res = simple_read_from_buffer(userbuf, count, ppos, buf, pos);
-	up(&big_buffer_sem);
+	mutex_unlock(&big_buffer_mutex);
 	return res;
 }
 
@@ -160,7 +160,7 @@ static ssize_t spromdump_read_file(struc
 	ssize_t res;
 	unsigned long flags;
 
-	down(&big_buffer_sem);
+	mutex_lock(&big_buffer_mutex);
 	mutex_lock(&bcm->mutex);
 	spin_lock_irqsave(&bcm->irq_lock, flags);
 	if (bcm43xx_status(bcm) != BCM43xx_STAT_INITIALIZED) {
@@ -175,7 +175,7 @@ out:
 	spin_unlock_irqrestore(&bcm->irq_lock, flags);
 	mutex_unlock(&bcm->mutex);
 	res = simple_read_from_buffer(userbuf, count, ppos, buf, pos);
-	up(&big_buffer_sem);
+	mutex_unlock(&big_buffer_mutex);
 	return res;
 }
 
@@ -191,7 +191,7 @@ static ssize_t tsf_read_file(struct file
 	unsigned long flags;
 	u64 tsf;
 
-	down(&big_buffer_sem);
+	mutex_lock(&big_buffer_mutex);
 	mutex_lock(&bcm->mutex);
 	spin_lock_irqsave(&bcm->irq_lock, flags);
 	if (bcm43xx_status(bcm) != BCM43xx_STAT_INITIALIZED) {
@@ -207,7 +207,7 @@ out:
 	spin_unlock_irqrestore(&bcm->irq_lock, flags);
 	mutex_unlock(&bcm->mutex);
 	res = simple_read_from_buffer(userbuf, count, ppos, buf, pos);
-	up(&big_buffer_sem);
+	mutex_unlock(&big_buffer_mutex);
 	return res;
 }
 
@@ -222,7 +222,7 @@ static ssize_t tsf_write_file(struct fil
 	unsigned long long tsf;
 
 	buf_size = min(count, sizeof (really_big_buffer) - 1);
-	down(&big_buffer_sem);
+	mutex_lock(&big_buffer_mutex);
 	if (copy_from_user(buf, user_buf, buf_size)) {
 	        res = -EFAULT;
 		goto out_up;
@@ -247,7 +247,7 @@ out_unlock:
 	spin_unlock_irqrestore(&bcm->irq_lock, flags);
 	mutex_unlock(&bcm->mutex);
 out_up:
-	up(&big_buffer_sem);
+	mutex_unlock(&big_buffer_mutex);
 	return res;
 }
 
@@ -265,7 +265,7 @@ static ssize_t txstat_read_file(struct f
 	struct bcm43xx_xmitstatus *status;
 	int i, cnt, j = 0;
 
-	down(&big_buffer_sem);
+	mutex_lock(&big_buffer_mutex);
 	mutex_lock(&bcm->mutex);
 	spin_lock_irqsave(&bcm->irq_lock, flags);
 
@@ -312,7 +312,7 @@ static ssize_t txstat_read_file(struct f
 	}
 	spin_unlock_irqrestore(&bcm->irq_lock, flags);
 	mutex_unlock(&bcm->mutex);
-	up(&big_buffer_sem);
+	mutex_unlock(&big_buffer_mutex);
 	return res;
 }
 
@@ -326,7 +326,7 @@ static ssize_t restart_write_file(struct
 	unsigned long flags;
 
 	buf_size = min(count, sizeof (really_big_buffer) - 1);
-	down(&big_buffer_sem);
+	mutex_lock(&big_buffer_mutex);
 	if (copy_from_user(buf, user_buf, buf_size)) {
 	        res = -EFAULT;
 		goto out_up;
@@ -348,7 +348,7 @@ out_unlock:
 	spin_unlock_irqrestore(&(bcm)->irq_lock, flags);
 	mutex_unlock(&(bcm)->mutex);
 out_up:
-	up(&big_buffer_sem);
+	mutex_unlock(&big_buffer_mutex);
 	return res;
 }
 

-- 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux