#include <linux/pci.h>
#include <linux/timer.h>
#include <linux/jiffies.h>
+#include <linux/mutex.h>
#include "csr1212.h"
#include "ieee1394.h"
* Return Value: a pointer to the &hpsb_host if succesful, %NULL if
* 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 device *dev)
h->topology_map = h->csr.topology_map + 3;
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))
hostnum++;
class_device_register(&h->class_dev);
get_device(&h->device);
- up(&host_num_alloc);
+ mutex_unlock(&host_num_alloc);
return h;
}