diff options
-rw-r--r-- | drivers/firewire/fw-card.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c index b2aa85555a7a..3322d6169bd1 100644 --- a/drivers/firewire/fw-card.c +++ b/drivers/firewire/fw-card.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <linux/module.h> | 19 | #include <linux/module.h> |
20 | #include <linux/errno.h> | 20 | #include <linux/errno.h> |
21 | #include <linux/device.h> | 21 | #include <linux/device.h> |
22 | #include <linux/rwsem.h> | 22 | #include <linux/mutex.h> |
23 | #include <linux/crc-itu-t.h> | 23 | #include <linux/crc-itu-t.h> |
24 | #include "fw-transaction.h" | 24 | #include "fw-transaction.h" |
25 | #include "fw-topology.h" | 25 | #include "fw-topology.h" |
@@ -38,7 +38,7 @@ int fw_compute_block_crc(u32 *block) | |||
38 | return length; | 38 | return length; |
39 | } | 39 | } |
40 | 40 | ||
41 | static DECLARE_RWSEM(card_rwsem); | 41 | static DEFINE_MUTEX(card_mutex); |
42 | static LIST_HEAD(card_list); | 42 | static LIST_HEAD(card_list); |
43 | 43 | ||
44 | static LIST_HEAD(descriptor_list); | 44 | static LIST_HEAD(descriptor_list); |
@@ -154,7 +154,7 @@ fw_core_add_descriptor (struct fw_descriptor *desc) | |||
154 | if (i != desc->length) | 154 | if (i != desc->length) |
155 | return -EINVAL; | 155 | return -EINVAL; |
156 | 156 | ||
157 | down_write(&card_rwsem); | 157 | mutex_lock(&card_mutex); |
158 | 158 | ||
159 | list_add_tail (&desc->link, &descriptor_list); | 159 | list_add_tail (&desc->link, &descriptor_list); |
160 | descriptor_count++; | 160 | descriptor_count++; |
@@ -162,7 +162,7 @@ fw_core_add_descriptor (struct fw_descriptor *desc) | |||
162 | descriptor_count++; | 162 | descriptor_count++; |
163 | update_config_roms(); | 163 | update_config_roms(); |
164 | 164 | ||
165 | up_write(&card_rwsem); | 165 | mutex_unlock(&card_mutex); |
166 | 166 | ||
167 | return 0; | 167 | return 0; |
168 | } | 168 | } |
@@ -171,7 +171,7 @@ EXPORT_SYMBOL(fw_core_add_descriptor); | |||
171 | void | 171 | void |
172 | fw_core_remove_descriptor (struct fw_descriptor *desc) | 172 | fw_core_remove_descriptor (struct fw_descriptor *desc) |
173 | { | 173 | { |
174 | down_write(&card_rwsem); | 174 | mutex_lock(&card_mutex); |
175 | 175 | ||
176 | list_del(&desc->link); | 176 | list_del(&desc->link); |
177 | descriptor_count--; | 177 | descriptor_count--; |
@@ -179,7 +179,7 @@ fw_core_remove_descriptor (struct fw_descriptor *desc) | |||
179 | descriptor_count--; | 179 | descriptor_count--; |
180 | update_config_roms(); | 180 | update_config_roms(); |
181 | 181 | ||
182 | up_write(&card_rwsem); | 182 | mutex_unlock(&card_mutex); |
183 | } | 183 | } |
184 | EXPORT_SYMBOL(fw_core_remove_descriptor); | 184 | EXPORT_SYMBOL(fw_core_remove_descriptor); |
185 | 185 | ||
@@ -418,10 +418,10 @@ fw_card_add(struct fw_card *card, | |||
418 | */ | 418 | */ |
419 | fw_card_get(card); | 419 | fw_card_get(card); |
420 | 420 | ||
421 | down_write(&card_rwsem); | 421 | mutex_lock(&card_mutex); |
422 | config_rom = generate_config_rom (card, &length); | 422 | config_rom = generate_config_rom (card, &length); |
423 | list_add_tail(&card->link, &card_list); | 423 | list_add_tail(&card->link, &card_list); |
424 | up_write(&card_rwsem); | 424 | mutex_unlock(&card_mutex); |
425 | 425 | ||
426 | return card->driver->enable(card, config_rom, length); | 426 | return card->driver->enable(card, config_rom, length); |
427 | } | 427 | } |
@@ -505,9 +505,9 @@ fw_core_remove_card(struct fw_card *card) | |||
505 | PHY_LINK_ACTIVE | PHY_CONTENDER, 0); | 505 | PHY_LINK_ACTIVE | PHY_CONTENDER, 0); |
506 | fw_core_initiate_bus_reset(card, 1); | 506 | fw_core_initiate_bus_reset(card, 1); |
507 | 507 | ||
508 | down_write(&card_rwsem); | 508 | mutex_lock(&card_mutex); |
509 | list_del(&card->link); | 509 | list_del(&card->link); |
510 | up_write(&card_rwsem); | 510 | mutex_unlock(&card_mutex); |
511 | 511 | ||
512 | /* Set up the dummy driver. */ | 512 | /* Set up the dummy driver. */ |
513 | card->driver = &dummy_driver; | 513 | card->driver = &dummy_driver; |