aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorManuel Lauss <manuel.lauss@googlemail.com>2010-01-04 16:29:49 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-01-04 18:30:01 +0000
commitecbec242961ec66e900b5649ded1e40f5d5edc41 (patch)
tree76c0e1c156e9ee0132049f93fe9b7e9e46fa0ba4 /sound
parent7f50548abb5454bd82c25aae15f0a3bf6a530f46 (diff)
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 69bd0acc81c..a1bbe16b7f9 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)