]> err.no Git - linux-2.6/commitdiff
[ALSA] hda-codec - Fix wrong error checks in patch_{realtek,analog}.c
authorTakashi Iwai <tiwai@suse.de>
Tue, 10 Oct 2006 17:49:31 +0000 (19:49 +0200)
committerJaroslav Kysela <perex@server.perex.cz>
Wed, 20 Dec 2006 07:55:39 +0000 (08:55 +0100)
Fix wrong error checks of *_ch_mode_put() in patch_realtek.c and
patch_analog.c.  snd_hda_ch_mode_put() could return a positive
value for success, too.

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

index edd22dec8286e0161b57a0ce4570bf060a572b3b..2e0db62ed081a2309abb3c25a5e8aec1e399ef1e 100644 (file)
@@ -1640,7 +1640,7 @@ static int ad198x_ch_mode_put(struct snd_kcontrol *kcontrol,
        int err = snd_hda_ch_mode_put(codec, ucontrol, spec->channel_mode,
                                      spec->num_channel_mode,
                                      &spec->multiout.max_channels);
-       if (! err && spec->need_dac_fix)
+       if (err >= 0 && spec->need_dac_fix)
                spec->multiout.num_dacs = spec->multiout.max_channels / 2;
        return err;
 }
index fb961448db199701271a4688840b8a1e300f983f..5f55679df136f04470e43e9aec4c16aacf24f579 100644 (file)
@@ -271,7 +271,7 @@ static int alc_ch_mode_put(struct snd_kcontrol *kcontrol,
        int err = snd_hda_ch_mode_put(codec, ucontrol, spec->channel_mode,
                                      spec->num_channel_mode,
                                      &spec->multiout.max_channels);
-       if (! err && spec->need_dac_fix)
+       if (err >= 0 && spec->need_dac_fix)
                spec->multiout.num_dacs = spec->multiout.max_channels / 2;
        return err;
 }