aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-05-29 22:54:18 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-05-29 22:54:18 -0400
commitd21685ec258f803d3badae5eae821383a34815a9 (patch)
tree7ab60a2a5d557a4f345b01a79ca2f877c06d9b92 /sound/soc/soc-core.c
parent74ab24af4fe165de5af01d0507250dd099f096b0 (diff)
parentea02c63d57d7ec099f66ddb2942b4022e865cd5f (diff)
Merge branch 'for-2.6.40' into for-2.6.41
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index c261eeb835b..13a40fc78d3 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -242,7 +242,7 @@ static ssize_t codec_reg_write_file(struct file *file,
242 const char __user *user_buf, size_t count, loff_t *ppos) 242 const char __user *user_buf, size_t count, loff_t *ppos)
243{ 243{
244 char buf[32]; 244 char buf[32];
245 int buf_size; 245 size_t buf_size;
246 char *start = buf; 246 char *start = buf;
247 unsigned long reg, value; 247 unsigned long reg, value;
248 int step = 1; 248 int step = 1;
@@ -1307,10 +1307,6 @@ static int soc_bind_dai_link(struct snd_soc_card *card, int num)
1307 /* no, then find CPU DAI from registered DAIs*/ 1307 /* no, then find CPU DAI from registered DAIs*/
1308 list_for_each_entry(cpu_dai, &dai_list, list) { 1308 list_for_each_entry(cpu_dai, &dai_list, list) {
1309 if (!strcmp(cpu_dai->name, dai_link->cpu_dai_name)) { 1309 if (!strcmp(cpu_dai->name, dai_link->cpu_dai_name)) {
1310
1311 if (!try_module_get(cpu_dai->dev->driver->owner))
1312 return -ENODEV;
1313
1314 rtd->cpu_dai = cpu_dai; 1310 rtd->cpu_dai = cpu_dai;
1315 goto find_codec; 1311 goto find_codec;
1316 } 1312 }
@@ -1623,11 +1619,15 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num)
1623 1619
1624 /* probe the cpu_dai */ 1620 /* probe the cpu_dai */
1625 if (!cpu_dai->probed) { 1621 if (!cpu_dai->probed) {
1622 if (!try_module_get(cpu_dai->dev->driver->owner))
1623 return -ENODEV;
1624
1626 if (cpu_dai->driver->probe) { 1625 if (cpu_dai->driver->probe) {
1627 ret = cpu_dai->driver->probe(cpu_dai); 1626 ret = cpu_dai->driver->probe(cpu_dai);
1628 if (ret < 0) { 1627 if (ret < 0) {
1629 printk(KERN_ERR "asoc: failed to probe CPU DAI %s\n", 1628 printk(KERN_ERR "asoc: failed to probe CPU DAI %s\n",
1630 cpu_dai->name); 1629 cpu_dai->name);
1630 module_put(cpu_dai->dev->driver->owner);
1631 return ret; 1631 return ret;
1632 } 1632 }
1633 } 1633 }
@@ -1927,9 +1927,11 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
1927 card->num_dapm_routes); 1927 card->num_dapm_routes);
1928 1928
1929 snprintf(card->snd_card->shortname, sizeof(card->snd_card->shortname), 1929 snprintf(card->snd_card->shortname, sizeof(card->snd_card->shortname),
1930 "%s", card->name);
1931 snprintf(card->snd_card->longname, sizeof(card->snd_card->longname),
1932 "%s", card->name); 1930 "%s", card->name);
1931 snprintf(card->snd_card->longname, sizeof(card->snd_card->longname),
1932 "%s", card->long_name ? card->long_name : card->name);
1933 snprintf(card->snd_card->driver, sizeof(card->snd_card->driver),
1934 "%s", card->driver_name ? card->driver_name : card->name);
1933 1935
1934 if (card->late_probe) { 1936 if (card->late_probe) {
1935 ret = card->late_probe(card); 1937 ret = card->late_probe(card);