mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[ALSA] ASoC - Fix build warnings in soc-core.c
This patch fixes some build warnings in soc-core.c Changes:- o Check the return value of soc_ac97_dev_register() o Check return value of calls to device_create_file() Signed-off-by: Liam Girdwood <liam.girdwood@wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
This commit is contained in:
parent
cbcc2c4c07
commit
12e74f7d43
1 changed files with 26 additions and 9 deletions
|
@ -1438,12 +1438,18 @@ int snd_soc_register_card(struct snd_soc_device *socdev)
|
||||||
{
|
{
|
||||||
struct snd_soc_codec *codec = socdev->codec;
|
struct snd_soc_codec *codec = socdev->codec;
|
||||||
struct snd_soc_machine *machine = socdev->machine;
|
struct snd_soc_machine *machine = socdev->machine;
|
||||||
int ret = 0, i, ac97 = 0;
|
int ret = 0, i, ac97 = 0, err = 0;
|
||||||
|
|
||||||
mutex_lock(&codec->mutex);
|
mutex_lock(&codec->mutex);
|
||||||
for(i = 0; i < machine->num_links; i++) {
|
for(i = 0; i < machine->num_links; i++) {
|
||||||
if (socdev->machine->dai_link[i].init)
|
if (socdev->machine->dai_link[i].init) {
|
||||||
socdev->machine->dai_link[i].init(codec);
|
err = socdev->machine->dai_link[i].init(codec);
|
||||||
|
if (err < 0) {
|
||||||
|
printk(KERN_ERR "asoc: failed to init %s\n",
|
||||||
|
socdev->machine->dai_link[i].stream_name);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (socdev->machine->dai_link[i].cpu_dai->type == SND_SOC_DAI_AC97)
|
if (socdev->machine->dai_link[i].cpu_dai->type == SND_SOC_DAI_AC97)
|
||||||
ac97 = 1;
|
ac97 = 1;
|
||||||
}
|
}
|
||||||
|
@ -1456,17 +1462,28 @@ int snd_soc_register_card(struct snd_soc_device *socdev)
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
printk(KERN_ERR "asoc: failed to register soundcard for codec %s\n",
|
printk(KERN_ERR "asoc: failed to register soundcard for codec %s\n",
|
||||||
codec->name);
|
codec->name);
|
||||||
mutex_unlock(&codec->mutex);
|
goto out;
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SND_SOC_AC97_BUS
|
#ifdef CONFIG_SND_SOC_AC97_BUS
|
||||||
if (ac97)
|
if (ac97) {
|
||||||
soc_ac97_dev_register(codec);
|
ret = soc_ac97_dev_register(codec);
|
||||||
|
if (ret < 0) {
|
||||||
|
printk(KERN_ERR "asoc: AC97 device register failed\n");
|
||||||
|
snd_card_free(codec->card);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
snd_soc_dapm_sys_add(socdev->dev);
|
err = snd_soc_dapm_sys_add(socdev->dev);
|
||||||
device_create_file(socdev->dev, &dev_attr_codec_reg);
|
if (err < 0)
|
||||||
|
printk(KERN_WARNING "asoc: failed to add dapm sysfs entries\n");
|
||||||
|
|
||||||
|
err = device_create_file(socdev->dev, &dev_attr_codec_reg);
|
||||||
|
if (err < 0)
|
||||||
|
printk(KERN_WARNING "asoc: failed to add codec sysfs entries\n");
|
||||||
|
out:
|
||||||
mutex_unlock(&codec->mutex);
|
mutex_unlock(&codec->mutex);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue