diff options
Diffstat (limited to 'drivers/ieee1394')
-rw-r--r-- | drivers/ieee1394/hosts.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/ieee1394/hosts.c b/drivers/ieee1394/hosts.c index ba09741fc826..2d47b11777a5 100644 --- a/drivers/ieee1394/hosts.c +++ b/drivers/ieee1394/hosts.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/pci.h> | 19 | #include <linux/pci.h> |
20 | #include <linux/timer.h> | 20 | #include <linux/timer.h> |
21 | #include <linux/jiffies.h> | 21 | #include <linux/jiffies.h> |
22 | #include <linux/mutex.h> | ||
22 | 23 | ||
23 | #include "csr1212.h" | 24 | #include "csr1212.h" |
24 | #include "ieee1394.h" | 25 | #include "ieee1394.h" |
@@ -105,7 +106,7 @@ static int alloc_hostnum_cb(struct hpsb_host *host, void *__data) | |||
105 | * Return Value: a pointer to the &hpsb_host if succesful, %NULL if | 106 | * Return Value: a pointer to the &hpsb_host if succesful, %NULL if |
106 | * no memory was available. | 107 | * no memory was available. |
107 | */ | 108 | */ |
108 | static DECLARE_MUTEX(host_num_alloc); | 109 | static DEFINE_MUTEX(host_num_alloc); |
109 | 110 | ||
110 | struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, | 111 | struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, |
111 | struct device *dev) | 112 | struct device *dev) |
@@ -148,7 +149,7 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, | |||
148 | h->topology_map = h->csr.topology_map + 3; | 149 | h->topology_map = h->csr.topology_map + 3; |
149 | h->speed_map = (u8 *)(h->csr.speed_map + 2); | 150 | h->speed_map = (u8 *)(h->csr.speed_map + 2); |
150 | 151 | ||
151 | down(&host_num_alloc); | 152 | mutex_lock(&host_num_alloc); |
152 | 153 | ||
153 | while (nodemgr_for_each_host(&hostnum, alloc_hostnum_cb)) | 154 | while (nodemgr_for_each_host(&hostnum, alloc_hostnum_cb)) |
154 | hostnum++; | 155 | hostnum++; |
@@ -167,7 +168,7 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, | |||
167 | class_device_register(&h->class_dev); | 168 | class_device_register(&h->class_dev); |
168 | get_device(&h->device); | 169 | get_device(&h->device); |
169 | 170 | ||
170 | up(&host_num_alloc); | 171 | mutex_unlock(&host_num_alloc); |
171 | 172 | ||
172 | return h; | 173 | return h; |
173 | } | 174 | } |