summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorManuel Lauss <manuel.lauss@googlemail.com>2010-01-04 18:29:49 +0300
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-01-04 21:30:01 +0300
commitecbec242961ec66e900b5649ded1e40f5d5edc41 (patch)
tree76c0e1c156e9ee0132049f93fe9b7e9e46fa0ba4 /sound
parent7f50548abb5454bd82c25aae15f0a3bf6a530f46 (diff)
downloadlinux-ecbec242961ec66e900b5649ded1e40f5d5edc41.tar.xz
ASoC: fixup oops in generic AC97 codec glue
Initialize the glue by calling snd_soc_new_ac97_codec() as is done in other ASoC AC97 codecs. Fixes an oops caused by dereferencing uninitialized members in snd_soc_new_pcms(). Run-tested on Au1250. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/ac97.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c
index 69bd0acc81c8..a1bbe16b7f96 100644
--- a/sound/soc/codecs/ac97.c
+++ b/sound/soc/codecs/ac97.c
@@ -102,6 +102,12 @@ static int ac97_soc_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&codec->dapm_widgets);
INIT_LIST_HEAD(&codec->dapm_paths);
+ ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
+ if (ret < 0) {
+ printk(KERN_ERR "ASoC: failed to init gen ac97 glue\n");
+ goto err;
+ }
+
/* register pcms */
ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
if (ret < 0)