summaryrefslogtreecommitdiff
path: root/sound/firewire/speakers.c
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2011-08-27 18:53:03 +0200
committerStefan Richter <stefanr@s5r6.in-berlin.de>2012-01-15 18:37:20 +0100
commit210762268466634ddbfaddb48fdf5181ce4b5f2d (patch)
tree8c07da360066158aa48f450dfeb593ed9ed76d0f /sound/firewire/speakers.c
parent2ca526bf4953380abfe5dff455e356967b239c70 (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.c4
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)
static void fwspk_card_free(struct snd_card *card)
{
struct fwspk *fwspk = card->private_data;
- struct fw_device *dev = fw_parent_device(fwspk->unit);
amdtp_out_stream_destroy(&fwspk->stream);
cmp_connection_destroy(&fwspk->connection);
fw_unit_put(fwspk->unit);
- fw_device_put(dev);
mutex_destroy(&fwspk->mutex);
}
@@ -718,7 +716,6 @@ static int __devinit fwspk_probe(struct device *unit_dev)
fwspk = card->private_data;
fwspk->card = card;
mutex_init(&fwspk->mutex);
- fw_device_get(fw_dev);
fwspk->unit = fw_unit_get(unit);
fwspk->device_info = fwspk_detect(fw_dev);
if (!fwspk->device_info) {
@@ -767,7 +764,6 @@ err_connection:
cmp_connection_destroy(&fwspk->connection);
err_unit:
fw_unit_put(fwspk->unit);
- fw_device_put(fw_dev);
mutex_destroy(&fwspk->mutex);
error:
snd_card_free(card);