]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/soc/pxa/spitz.c
Merge branch 'origin' into devel
[linux-2.6-omap-h63xx.git] / sound / soc / pxa / spitz.c
index de8778fa872971d3e36a0d422806dd37c9a7b86d..c4cd2acaacb47a239ffd5cad78d304dc8987012c 100644 (file)
@@ -107,7 +107,7 @@ static void spitz_ext_control(struct snd_soc_codec *codec)
 static int spitz_startup(struct snd_pcm_substream *substream)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_codec *codec = rtd->socdev->codec;
+       struct snd_soc_codec *codec = rtd->socdev->card->codec;
 
        /* check the jack status at stream startup */
        spitz_ext_control(codec);
@@ -276,7 +276,7 @@ static const struct snd_kcontrol_new wm8750_spitz_controls[] = {
  */
 static int spitz_wm8750_init(struct snd_soc_codec *codec)
 {
-       int i, err;
+       int err;
 
        /* NC codec pins */
        snd_soc_dapm_nc_pin(codec, "RINPUT1");
@@ -288,12 +288,10 @@ static int spitz_wm8750_init(struct snd_soc_codec *codec)
        snd_soc_dapm_nc_pin(codec, "MONO1");
 
        /* Add spitz specific controls */
-       for (i = 0; i < ARRAY_SIZE(wm8750_spitz_controls); i++) {
-               err = snd_ctl_add(codec->card,
-                       snd_soc_cnew(&wm8750_spitz_controls[i], codec, NULL));
-               if (err < 0)
-                       return err;
-       }
+       err = snd_soc_add_controls(codec, wm8750_spitz_controls,
+                               ARRAY_SIZE(wm8750_spitz_controls));
+       if (err < 0)
+               return err;
 
        /* Add spitz specific widgets */
        snd_soc_dapm_new_controls(codec, wm8750_dapm_widgets,