diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2008-02-24 12:59:55 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2008-04-18 11:55:31 -0400 |
commit | bd7dee6311156b7cdf884344feb34628909398ad (patch) | |
tree | 669b5747c607266e495e6f1b1516663bdca1152a /drivers/firewire/fw-card.c | |
parent | a6ca4f7081095e3cdeb1a45d66fbe4856eca10d3 (diff) |
firewire: remove superfluous reference counting
The card->kref became obsolete since patch "firewire: fix crash in
automatic module unloading" added another counter of card users.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Jarod Wilson <jwilson@redhat.com>
Diffstat (limited to 'drivers/firewire/fw-card.c')
-rw-r--r-- | drivers/firewire/fw-card.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c index a03462750b95..140b34d477de 100644 --- a/drivers/firewire/fw-card.c +++ b/drivers/firewire/fw-card.c | |||
@@ -398,7 +398,6 @@ fw_card_initialize(struct fw_card *card, const struct fw_card_driver *driver, | |||
398 | { | 398 | { |
399 | static atomic_t index = ATOMIC_INIT(-1); | 399 | static atomic_t index = ATOMIC_INIT(-1); |
400 | 400 | ||
401 | kref_init(&card->kref); | ||
402 | atomic_set(&card->device_count, 0); | 401 | atomic_set(&card->device_count, 0); |
403 | card->index = atomic_inc_return(&index); | 402 | card->index = atomic_inc_return(&index); |
404 | card->driver = driver; | 403 | card->driver = driver; |
@@ -429,12 +428,6 @@ fw_card_add(struct fw_card *card, | |||
429 | card->link_speed = link_speed; | 428 | card->link_speed = link_speed; |
430 | card->guid = guid; | 429 | card->guid = guid; |
431 | 430 | ||
432 | /* | ||
433 | * The subsystem grabs a reference when the card is added and | ||
434 | * drops it when the driver calls fw_core_remove_card. | ||
435 | */ | ||
436 | fw_card_get(card); | ||
437 | |||
438 | mutex_lock(&card_mutex); | 431 | mutex_lock(&card_mutex); |
439 | config_rom = generate_config_rom(card, &length); | 432 | config_rom = generate_config_rom(card, &length); |
440 | list_add_tail(&card->link, &card_list); | 433 | list_add_tail(&card->link, &card_list); |
@@ -540,40 +533,9 @@ fw_core_remove_card(struct fw_card *card) | |||
540 | cancel_delayed_work_sync(&card->work); | 533 | cancel_delayed_work_sync(&card->work); |
541 | fw_flush_transactions(card); | 534 | fw_flush_transactions(card); |
542 | del_timer_sync(&card->flush_timer); | 535 | del_timer_sync(&card->flush_timer); |
543 | |||
544 | fw_card_put(card); | ||
545 | } | 536 | } |
546 | EXPORT_SYMBOL(fw_core_remove_card); | 537 | EXPORT_SYMBOL(fw_core_remove_card); |
547 | 538 | ||
548 | struct fw_card * | ||
549 | fw_card_get(struct fw_card *card) | ||
550 | { | ||
551 | kref_get(&card->kref); | ||
552 | |||
553 | return card; | ||
554 | } | ||
555 | EXPORT_SYMBOL(fw_card_get); | ||
556 | |||
557 | static void | ||
558 | release_card(struct kref *kref) | ||
559 | { | ||
560 | struct fw_card *card = container_of(kref, struct fw_card, kref); | ||
561 | |||
562 | kfree(card); | ||
563 | } | ||
564 | |||
565 | /* | ||
566 | * An assumption for fw_card_put() is that the card driver allocates | ||
567 | * the fw_card struct with kalloc and that it has been shut down | ||
568 | * before the last ref is dropped. | ||
569 | */ | ||
570 | void | ||
571 | fw_card_put(struct fw_card *card) | ||
572 | { | ||
573 | kref_put(&card->kref, release_card); | ||
574 | } | ||
575 | EXPORT_SYMBOL(fw_card_put); | ||
576 | |||
577 | int | 539 | int |
578 | fw_core_initiate_bus_reset(struct fw_card *card, int short_reset) | 540 | fw_core_initiate_bus_reset(struct fw_card *card, int short_reset) |
579 | { | 541 | { |