summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorLiam Girdwood <lrg@ti.com>2011-07-24 20:59:43 +0100
committerAndy Green <andy.green@linaro.org>2011-08-25 07:38:03 +0100
commitacc6016ab74db1e7fc77a2cb028a8361ebf28b2b (patch)
treee4054767d8c74a3436c8ce63afd35f8fcc75c31e /sound
parent2d94e5af43d7e400593d2f575f1861e79292fad4 (diff)
Subject: [PATCH 073/104] ASoC: core - module refcounting improvements fro DSP
DSP components can have DAIs that can exist in either the CODEC driver or platform DAI driver. Simplify DAI refcounting logic by ref counting all (CODEC and platform) DAIs in each sound card. Signed-off-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index a00637c37a3..7385635153b 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -960,6 +960,7 @@ static void soc_remove_dai_link(struct snd_soc_card *card, int num, int order)
}
codec_dai->probed = 0;
list_del(&codec_dai->card_list);
+ module_put(codec_dai->dev->driver->owner);
}
/* remove the platform */
@@ -1252,11 +1253,14 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num, int order)
/* probe the CODEC DAI */
if (!codec_dai->probed && codec_dai->driver->probe_order == order) {
+ if (!try_module_get(codec_dai->dev->driver->owner))
+ return -ENODEV;
if (codec_dai->driver->probe) {
ret = codec_dai->driver->probe(codec_dai);
if (ret < 0) {
printk(KERN_ERR "asoc: failed to probe CODEC DAI %s\n",
codec_dai->name);
+ module_put(codec_dai->dev->driver->owner);
return ret;
}
}