[ALSA] hda-codec - Fix ALC662 auto-configuration code
authorTakashi Iwai <tiwai@suse.de>
Tue, 19 Jun 2007 10:11:16 +0000 (12:11 +0200)
committerJaroslav Kysela <perex@suse.cz>
Fri, 20 Jul 2007 09:11:29 +0000 (11:11 +0200)
The auto-configuration code didn't initialize the verbs correctly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
sound/pci/hda/patch_realtek.c

index d2cadb2038da9f050f51a90e75f8e3b72e066f02..9c5c3cfa5ec7a73efce3611085a6ff749fc1d697 100644 (file)
@@ -11169,12 +11169,10 @@ static int alc662_parse_auto_config(struct hda_codec *codec)
        
        if (err < 0)
                return err;
-       else if (err > 0)
-               /* hack - override the init verbs */
-               spec->init_verbs[0] = alc662_auto_init_verbs;
+       spec->init_verbs[spec->num_init_verbs++] = alc662_auto_init_verbs;
        spec->mixers[spec->num_mixers] = alc662_capture_mixer;
        spec->num_mixers++;
-       return err;
+       return 1;
 }
 
 /* additional initialization for auto-configuration model */
@@ -11211,7 +11209,7 @@ static int patch_alc662(struct hda_codec *codec)
                if (err < 0) {
                        alc_free(codec);
                        return err;
-               } else if (err) {
+               } else if (!err) {
                        printk(KERN_INFO
                               "hda_codec: Cannot set up configuration "
                               "from BIOS.  Using base mode...\n");