Browse Source

From: Arjan van de Ven <arjan@infradead.org>

Semaphore to mutex conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Ben Collins <bcollins@debian.org>
Cc: Jody McIntyre <scjody@modernduck.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
Ben Collins 19 years ago
parent
commit
fa7614de60
1 changed files with 4 additions and 3 deletions
  1. 4 3
      drivers/ieee1394/hosts.c

+ 4 - 3
drivers/ieee1394/hosts.c

@@ -19,6 +19,7 @@
 #include <linux/pci.h>
 #include <linux/pci.h>
 #include <linux/timer.h>
 #include <linux/timer.h>
 #include <linux/jiffies.h>
 #include <linux/jiffies.h>
+#include <linux/mutex.h>
 
 
 #include "csr1212.h"
 #include "csr1212.h"
 #include "ieee1394.h"
 #include "ieee1394.h"
@@ -105,7 +106,7 @@ static int alloc_hostnum_cb(struct hpsb_host *host, void *__data)
  * Return Value: a pointer to the &hpsb_host if succesful, %NULL if
  * Return Value: a pointer to the &hpsb_host if succesful, %NULL if
  * no memory was available.
  * no memory was available.
  */
  */
-static DECLARE_MUTEX(host_num_alloc);
+static DEFINE_MUTEX(host_num_alloc);
 
 
 struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
 struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
 				  struct device *dev)
 				  struct device *dev)
@@ -148,7 +149,7 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
 	h->topology_map = h->csr.topology_map + 3;
 	h->topology_map = h->csr.topology_map + 3;
 	h->speed_map = (u8 *)(h->csr.speed_map + 2);
 	h->speed_map = (u8 *)(h->csr.speed_map + 2);
 
 
-	down(&host_num_alloc);
+	mutex_lock(&host_num_alloc);
 
 
 	while (nodemgr_for_each_host(&hostnum, alloc_hostnum_cb))
 	while (nodemgr_for_each_host(&hostnum, alloc_hostnum_cb))
 		hostnum++;
 		hostnum++;
@@ -167,7 +168,7 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
 	class_device_register(&h->class_dev);
 	class_device_register(&h->class_dev);
 	get_device(&h->device);
 	get_device(&h->device);
 
 
-	up(&host_num_alloc);
+	mutex_unlock(&host_num_alloc);
 
 
 	return h;
 	return h;
 }
 }