aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/soc-core.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 5f86e033098f..9eb5479787c1 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1101,7 +1101,6 @@ int snd_soc_register_card(struct snd_soc_device *socdev)
1101 struct snd_soc_machine *machine = socdev->machine; 1101 struct snd_soc_machine *machine = socdev->machine;
1102 int ret = 0, i, ac97 = 0, err = 0; 1102 int ret = 0, i, ac97 = 0, err = 0;
1103 1103
1104 mutex_lock(&codec->mutex);
1105 for(i = 0; i < machine->num_links; i++) { 1104 for(i = 0; i < machine->num_links; i++) {
1106 if (socdev->machine->dai_link[i].init) { 1105 if (socdev->machine->dai_link[i].init) {
1107 err = socdev->machine->dai_link[i].init(codec); 1106 err = socdev->machine->dai_link[i].init(codec);
@@ -1127,12 +1126,14 @@ int snd_soc_register_card(struct snd_soc_device *socdev)
1127 goto out; 1126 goto out;
1128 } 1127 }
1129 1128
1129 mutex_lock(&codec->mutex);
1130#ifdef CONFIG_SND_SOC_AC97_BUS 1130#ifdef CONFIG_SND_SOC_AC97_BUS
1131 if (ac97) { 1131 if (ac97) {
1132 ret = soc_ac97_dev_register(codec); 1132 ret = soc_ac97_dev_register(codec);
1133 if (ret < 0) { 1133 if (ret < 0) {
1134 printk(KERN_ERR "asoc: AC97 device register failed\n"); 1134 printk(KERN_ERR "asoc: AC97 device register failed\n");
1135 snd_card_free(codec->card); 1135 snd_card_free(codec->card);
1136 mutex_unlock(&codec->mutex);
1136 goto out; 1137 goto out;
1137 } 1138 }
1138 } 1139 }
@@ -1145,8 +1146,10 @@ int snd_soc_register_card(struct snd_soc_device *socdev)
1145 err = device_create_file(socdev->dev, &dev_attr_codec_reg); 1146 err = device_create_file(socdev->dev, &dev_attr_codec_reg);
1146 if (err < 0) 1147 if (err < 0)
1147 printk(KERN_WARNING "asoc: failed to add codec sysfs entries\n"); 1148 printk(KERN_WARNING "asoc: failed to add codec sysfs entries\n");
1148out: 1149
1149 mutex_unlock(&codec->mutex); 1150 mutex_unlock(&codec->mutex);
1151
1152out:
1150 return ret; 1153 return ret;
1151} 1154}
1152EXPORT_SYMBOL_GPL(snd_soc_register_card); 1155EXPORT_SYMBOL_GPL(snd_soc_register_card);