From ee6756e9812444b22c0bc5f3f812f64857fba4d1 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Tue, 24 May 2011 13:57:43 +0100 Subject: [PATCH] --- yaml --- r: 252120 b: refs/heads/master c: 61b61e3c5c9bf37ca2915ac981f444989ab22f10 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/sound/soc/soc-core.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 9c37e2493008..225770004d15 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 477a66948ef8683f182682cc68e8520baf8a5b43 +refs/heads/master: 61b61e3c5c9bf37ca2915ac981f444989ab22f10 diff --git a/trunk/sound/soc/soc-core.c b/trunk/sound/soc/soc-core.c index bb7cd5812945..07991d438796 100644 --- a/trunk/sound/soc/soc-core.c +++ b/trunk/sound/soc/soc-core.c @@ -1306,10 +1306,6 @@ static int soc_bind_dai_link(struct snd_soc_card *card, int num) /* no, then find CPU DAI from registered DAIs*/ list_for_each_entry(cpu_dai, &dai_list, list) { if (!strcmp(cpu_dai->name, dai_link->cpu_dai_name)) { - - if (!try_module_get(cpu_dai->dev->driver->owner)) - return -ENODEV; - rtd->cpu_dai = cpu_dai; goto find_codec; } @@ -1621,12 +1617,17 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num) rtd->pmdown_time = pmdown_time; /* probe the cpu_dai */ + if (!cpu_dai->probed) { + if (!try_module_get(cpu_dai->dev->driver->owner)) + return -ENODEV; + if (cpu_dai->driver->probe) { ret = cpu_dai->driver->probe(cpu_dai); if (ret < 0) { printk(KERN_ERR "asoc: failed to probe CPU DAI %s\n", cpu_dai->name); + module_put(cpu_dai->dev->driver->owner); return ret; } }