diff options
-rw-r--r-- | sound/soc/soc-core.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index bb7cd5812945..07991d438796 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1306,10 +1306,6 @@ static int soc_bind_dai_link(struct snd_soc_card *card, int num) | |||
1306 | /* no, then find CPU DAI from registered DAIs*/ | 1306 | /* no, then find CPU DAI from registered DAIs*/ |
1307 | list_for_each_entry(cpu_dai, &dai_list, list) { | 1307 | list_for_each_entry(cpu_dai, &dai_list, list) { |
1308 | if (!strcmp(cpu_dai->name, dai_link->cpu_dai_name)) { | 1308 | if (!strcmp(cpu_dai->name, dai_link->cpu_dai_name)) { |
1309 | |||
1310 | if (!try_module_get(cpu_dai->dev->driver->owner)) | ||
1311 | return -ENODEV; | ||
1312 | |||
1313 | rtd->cpu_dai = cpu_dai; | 1309 | rtd->cpu_dai = cpu_dai; |
1314 | goto find_codec; | 1310 | goto find_codec; |
1315 | } | 1311 | } |
@@ -1621,12 +1617,17 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num) | |||
1621 | rtd->pmdown_time = pmdown_time; | 1617 | rtd->pmdown_time = pmdown_time; |
1622 | 1618 | ||
1623 | /* probe the cpu_dai */ | 1619 | /* probe the cpu_dai */ |
1620 | |||
1624 | if (!cpu_dai->probed) { | 1621 | if (!cpu_dai->probed) { |
1622 | if (!try_module_get(cpu_dai->dev->driver->owner)) | ||
1623 | return -ENODEV; | ||
1624 | |||
1625 | if (cpu_dai->driver->probe) { | 1625 | if (cpu_dai->driver->probe) { |
1626 | ret = cpu_dai->driver->probe(cpu_dai); | 1626 | ret = cpu_dai->driver->probe(cpu_dai); |
1627 | if (ret < 0) { | 1627 | if (ret < 0) { |
1628 | printk(KERN_ERR "asoc: failed to probe CPU DAI %s\n", | 1628 | printk(KERN_ERR "asoc: failed to probe CPU DAI %s\n", |
1629 | cpu_dai->name); | 1629 | cpu_dai->name); |
1630 | module_put(cpu_dai->dev->driver->owner); | ||
1630 | return ret; | 1631 | return ret; |
1631 | } | 1632 | } |
1632 | } | 1633 | } |