diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2011-08-27 12:53:03 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2012-01-15 12:37:20 -0500 |
commit | 210762268466634ddbfaddb48fdf5181ce4b5f2d (patch) | |
tree | 8c07da360066158aa48f450dfeb593ed9ed76d0f /sound/firewire/speakers.c | |
parent | 2ca526bf4953380abfe5dff455e356967b239c70 (diff) |
firewire: move fw_device reference counting from drivers to core
fw_unit device drivers invariably need to talk to the fw_unit's parent
(an fw_device) and grandparent (an fw_card). firewire-core already
maintains an fw_card reference for the entire lifetime of an fw_device.
Likewise, let firewire-core maintain an fw_device reference for the
entire lifetime of an fw_unit so that fw_unit drivers don't have to.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'sound/firewire/speakers.c')
-rw-r--r-- | sound/firewire/speakers.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/sound/firewire/speakers.c b/sound/firewire/speakers.c index 3fc257da180c..18b9b5607f3c 100644 --- a/sound/firewire/speakers.c +++ b/sound/firewire/speakers.c | |||
@@ -656,12 +656,10 @@ static u32 fwspk_read_firmware_version(struct fw_unit *unit) | |||
656 | static void fwspk_card_free(struct snd_card *card) | 656 | static void fwspk_card_free(struct snd_card *card) |
657 | { | 657 | { |
658 | struct fwspk *fwspk = card->private_data; | 658 | struct fwspk *fwspk = card->private_data; |
659 | struct fw_device *dev = fw_parent_device(fwspk->unit); | ||
660 | 659 | ||
661 | amdtp_out_stream_destroy(&fwspk->stream); | 660 | amdtp_out_stream_destroy(&fwspk->stream); |
662 | cmp_connection_destroy(&fwspk->connection); | 661 | cmp_connection_destroy(&fwspk->connection); |
663 | fw_unit_put(fwspk->unit); | 662 | fw_unit_put(fwspk->unit); |
664 | fw_device_put(dev); | ||
665 | mutex_destroy(&fwspk->mutex); | 663 | mutex_destroy(&fwspk->mutex); |
666 | } | 664 | } |
667 | 665 | ||
@@ -718,7 +716,6 @@ static int __devinit fwspk_probe(struct device *unit_dev) | |||
718 | fwspk = card->private_data; | 716 | fwspk = card->private_data; |
719 | fwspk->card = card; | 717 | fwspk->card = card; |
720 | mutex_init(&fwspk->mutex); | 718 | mutex_init(&fwspk->mutex); |
721 | fw_device_get(fw_dev); | ||
722 | fwspk->unit = fw_unit_get(unit); | 719 | fwspk->unit = fw_unit_get(unit); |
723 | fwspk->device_info = fwspk_detect(fw_dev); | 720 | fwspk->device_info = fwspk_detect(fw_dev); |
724 | if (!fwspk->device_info) { | 721 | if (!fwspk->device_info) { |
@@ -767,7 +764,6 @@ err_connection: | |||
767 | cmp_connection_destroy(&fwspk->connection); | 764 | cmp_connection_destroy(&fwspk->connection); |
768 | err_unit: | 765 | err_unit: |
769 | fw_unit_put(fwspk->unit); | 766 | fw_unit_put(fwspk->unit); |
770 | fw_device_put(fw_dev); | ||
771 | mutex_destroy(&fwspk->mutex); | 767 | mutex_destroy(&fwspk->mutex); |
772 | error: | 768 | error: |
773 | snd_card_free(card); | 769 | snd_card_free(card); |