diff options
Diffstat (limited to 'drivers/firewire/core-card.c')
-rw-r--r-- | drivers/firewire/core-card.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c index 4c1be64fdddd..543fccac81bb 100644 --- a/drivers/firewire/core-card.c +++ b/drivers/firewire/core-card.c | |||
@@ -176,6 +176,7 @@ int fw_core_add_descriptor(struct fw_descriptor *desc) | |||
176 | 176 | ||
177 | return 0; | 177 | return 0; |
178 | } | 178 | } |
179 | EXPORT_SYMBOL(fw_core_add_descriptor); | ||
179 | 180 | ||
180 | void fw_core_remove_descriptor(struct fw_descriptor *desc) | 181 | void fw_core_remove_descriptor(struct fw_descriptor *desc) |
181 | { | 182 | { |
@@ -189,6 +190,7 @@ void fw_core_remove_descriptor(struct fw_descriptor *desc) | |||
189 | 190 | ||
190 | mutex_unlock(&card_mutex); | 191 | mutex_unlock(&card_mutex); |
191 | } | 192 | } |
193 | EXPORT_SYMBOL(fw_core_remove_descriptor); | ||
192 | 194 | ||
193 | static void allocate_broadcast_channel(struct fw_card *card, int generation) | 195 | static void allocate_broadcast_channel(struct fw_card *card, int generation) |
194 | { | 196 | { |
@@ -459,11 +461,11 @@ EXPORT_SYMBOL(fw_card_add); | |||
459 | 461 | ||
460 | 462 | ||
461 | /* | 463 | /* |
462 | * The next few functions implements a dummy driver that use once a | 464 | * The next few functions implement a dummy driver that is used once a card |
463 | * card driver shuts down an fw_card. This allows the driver to | 465 | * driver shuts down an fw_card. This allows the driver to cleanly unload, |
464 | * cleanly unload, as all IO to the card will be handled by the dummy | 466 | * as all IO to the card will be handled (and failed) by the dummy driver |
465 | * driver instead of calling into the (possibly) unloaded module. The | 467 | * instead of calling into the module. Only functions for iso context |
466 | * dummy driver just fails all IO. | 468 | * shutdown still need to be provided by the card driver. |
467 | */ | 469 | */ |
468 | 470 | ||
469 | static int dummy_enable(struct fw_card *card, u32 *config_rom, size_t length) | 471 | static int dummy_enable(struct fw_card *card, u32 *config_rom, size_t length) |
@@ -510,7 +512,7 @@ static int dummy_enable_phys_dma(struct fw_card *card, | |||
510 | return -ENODEV; | 512 | return -ENODEV; |
511 | } | 513 | } |
512 | 514 | ||
513 | static struct fw_card_driver dummy_driver = { | 515 | static const struct fw_card_driver dummy_driver_template = { |
514 | .enable = dummy_enable, | 516 | .enable = dummy_enable, |
515 | .update_phy_reg = dummy_update_phy_reg, | 517 | .update_phy_reg = dummy_update_phy_reg, |
516 | .set_config_rom = dummy_set_config_rom, | 518 | .set_config_rom = dummy_set_config_rom, |
@@ -529,6 +531,8 @@ void fw_card_release(struct kref *kref) | |||
529 | 531 | ||
530 | void fw_core_remove_card(struct fw_card *card) | 532 | void fw_core_remove_card(struct fw_card *card) |
531 | { | 533 | { |
534 | struct fw_card_driver dummy_driver = dummy_driver_template; | ||
535 | |||
532 | card->driver->update_phy_reg(card, 4, | 536 | card->driver->update_phy_reg(card, 4, |
533 | PHY_LINK_ACTIVE | PHY_CONTENDER, 0); | 537 | PHY_LINK_ACTIVE | PHY_CONTENDER, 0); |
534 | fw_core_initiate_bus_reset(card, 1); | 538 | fw_core_initiate_bus_reset(card, 1); |
@@ -537,7 +541,9 @@ void fw_core_remove_card(struct fw_card *card) | |||
537 | list_del_init(&card->link); | 541 | list_del_init(&card->link); |
538 | mutex_unlock(&card_mutex); | 542 | mutex_unlock(&card_mutex); |
539 | 543 | ||
540 | /* Set up the dummy driver. */ | 544 | /* Switch off most of the card driver interface. */ |
545 | dummy_driver.free_iso_context = card->driver->free_iso_context; | ||
546 | dummy_driver.stop_iso = card->driver->stop_iso; | ||
541 | card->driver = &dummy_driver; | 547 | card->driver = &dummy_driver; |
542 | 548 | ||
543 | fw_destroy_nodes(card); | 549 | fw_destroy_nodes(card); |