Commit 6bd25aae authored by Robert Jarzmik's avatar Robert Jarzmik Committed by Mark Brown

ASoC: wm97xx: fix compilation corner case

When the old AC97 is not used, CONFIG_SND_SOC_AC97_BUS is not
defined. As a consequence, in the error path, snd_soc_free_ac97_codec()
is not defined and triggers a compilation error.

Fix it for wm9705 and wm9712, as wm9713 is correctly written.
Signed-off-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Acked-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5aa3b03a
...@@ -321,7 +321,6 @@ static int wm9705_soc_probe(struct snd_soc_codec *codec) ...@@ -321,7 +321,6 @@ static int wm9705_soc_probe(struct snd_soc_codec *codec)
{ {
struct wm9705_priv *wm9705 = snd_soc_codec_get_drvdata(codec); struct wm9705_priv *wm9705 = snd_soc_codec_get_drvdata(codec);
struct regmap *regmap; struct regmap *regmap;
int ret;
if (wm9705->mfd_pdata) { if (wm9705->mfd_pdata) {
wm9705->ac97 = wm9705->mfd_pdata->ac97; wm9705->ac97 = wm9705->mfd_pdata->ac97;
...@@ -337,8 +336,8 @@ static int wm9705_soc_probe(struct snd_soc_codec *codec) ...@@ -337,8 +336,8 @@ static int wm9705_soc_probe(struct snd_soc_codec *codec)
regmap = regmap_init_ac97(wm9705->ac97, &wm9705_regmap_config); regmap = regmap_init_ac97(wm9705->ac97, &wm9705_regmap_config);
if (IS_ERR(regmap)) { if (IS_ERR(regmap)) {
ret = PTR_ERR(regmap); snd_soc_free_ac97_codec(wm9705->ac97);
goto err_free_ac97_codec; return PTR_ERR(regmap);
} }
#endif #endif
} }
...@@ -347,9 +346,6 @@ static int wm9705_soc_probe(struct snd_soc_codec *codec) ...@@ -347,9 +346,6 @@ static int wm9705_soc_probe(struct snd_soc_codec *codec)
snd_soc_codec_init_regmap(codec, regmap); snd_soc_codec_init_regmap(codec, regmap);
return 0; return 0;
err_free_ac97_codec:
snd_soc_free_ac97_codec(wm9705->ac97);
return ret;
} }
static int wm9705_soc_remove(struct snd_soc_codec *codec) static int wm9705_soc_remove(struct snd_soc_codec *codec)
......
...@@ -656,8 +656,8 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec) ...@@ -656,8 +656,8 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)
regmap = regmap_init_ac97(wm9712->ac97, &wm9712_regmap_config); regmap = regmap_init_ac97(wm9712->ac97, &wm9712_regmap_config);
if (IS_ERR(regmap)) { if (IS_ERR(regmap)) {
ret = PTR_ERR(regmap); snd_soc_free_ac97_codec(wm9712->ac97);
goto err_free_ac97_codec; return PTR_ERR(regmap);
} }
#endif #endif
} }
...@@ -668,9 +668,6 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec) ...@@ -668,9 +668,6 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)
snd_soc_update_bits(codec, AC97_VIDEO, 0x3000, 0x3000); snd_soc_update_bits(codec, AC97_VIDEO, 0x3000, 0x3000);
return 0; return 0;
err_free_ac97_codec:
snd_soc_free_ac97_codec(wm9712->ac97);
return ret;
} }
static int wm9712_soc_remove(struct snd_soc_codec *codec) static int wm9712_soc_remove(struct snd_soc_codec *codec)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment