aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-08-19 09:51:25 -0400
committerMark Brown <broonie@linaro.org>2014-08-19 11:59:46 -0400
commitffbd7dd72bd3ad9bcae9190788c858e57f1e8e4e (patch)
tree916016120495d45a90ca0bdec5a2b1bd3b23ce1d
parent70090bbb8b7d7da7a6f64969b43a61c493c560ff (diff)
ASoC: Cleanup DAI module reference counting
Currently when a DAI has no CODEC associated to it the reference on the module containing the DAI driver is increased when the DAI is probed and decrease when the DAI is removed. For DAIs with CODECs the module reference count was already incremented when the CODEC is probed. Now that all components have their module reference count incremented when they are probed and all DAIs do have a component it is possible to remove the module reference counting on DAI probe and removal. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--sound/soc/soc-core.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 2fbfbfca48dc..4dc2876c06de 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1067,8 +1067,6 @@ static void soc_remove_link_dais(struct snd_soc_card *card, int num, int order)
1067 cpu_dai->name, err); 1067 cpu_dai->name, err);
1068 } 1068 }
1069 cpu_dai->probed = 0; 1069 cpu_dai->probed = 0;
1070 if (!cpu_dai->codec)
1071 module_put(cpu_dai->dev->driver->owner);
1072 } 1070 }
1073} 1071}
1074 1072
@@ -1422,18 +1420,12 @@ static int soc_probe_link_dais(struct snd_soc_card *card, int num, int order)
1422 /* probe the cpu_dai */ 1420 /* probe the cpu_dai */
1423 if (!cpu_dai->probed && 1421 if (!cpu_dai->probed &&
1424 cpu_dai->driver->probe_order == order) { 1422 cpu_dai->driver->probe_order == order) {
1425 if (!cpu_dai->codec) {
1426 if (!try_module_get(cpu_dai->dev->driver->owner))
1427 return -ENODEV;
1428 }
1429
1430 if (cpu_dai->driver->probe) { 1423 if (cpu_dai->driver->probe) {
1431 ret = cpu_dai->driver->probe(cpu_dai); 1424 ret = cpu_dai->driver->probe(cpu_dai);
1432 if (ret < 0) { 1425 if (ret < 0) {
1433 dev_err(cpu_dai->dev, 1426 dev_err(cpu_dai->dev,
1434 "ASoC: failed to probe CPU DAI %s: %d\n", 1427 "ASoC: failed to probe CPU DAI %s: %d\n",
1435 cpu_dai->name, ret); 1428 cpu_dai->name, ret);
1436 module_put(cpu_dai->dev->driver->owner);
1437 return ret; 1429 return ret;
1438 } 1430 }
1439 } 1431 }