diff options
author | Takashi Iwai <tiwai@suse.de> | 2006-10-10 13:49:31 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@server.perex.cz> | 2006-12-20 02:55:39 -0500 |
commit | bd2033f27f346610b11b40a74ff7d1d023abcfd9 (patch) | |
tree | bbc250a3b9c525565179a9105f2313114a9d32b6 /sound | |
parent | d9301263cce69ee4ef989de5bbe57515ef71a780 (diff) |
[ALSA] hda-codec - Fix wrong error checks in patch_{realtek,analog}.c
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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/patch_analog.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index edd22dec8286..2e0db62ed081 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -1640,7 +1640,7 @@ static int ad198x_ch_mode_put(struct snd_kcontrol *kcontrol, | |||
1640 | int err = snd_hda_ch_mode_put(codec, ucontrol, spec->channel_mode, | 1640 | int err = snd_hda_ch_mode_put(codec, ucontrol, spec->channel_mode, |
1641 | spec->num_channel_mode, | 1641 | spec->num_channel_mode, |
1642 | &spec->multiout.max_channels); | 1642 | &spec->multiout.max_channels); |
1643 | if (! err && spec->need_dac_fix) | 1643 | if (err >= 0 && spec->need_dac_fix) |
1644 | spec->multiout.num_dacs = spec->multiout.max_channels / 2; | 1644 | spec->multiout.num_dacs = spec->multiout.max_channels / 2; |
1645 | return err; | 1645 | return err; |
1646 | } | 1646 | } |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index fb961448db19..5f55679df136 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -271,7 +271,7 @@ static int alc_ch_mode_put(struct snd_kcontrol *kcontrol, | |||
271 | int err = snd_hda_ch_mode_put(codec, ucontrol, spec->channel_mode, | 271 | int err = snd_hda_ch_mode_put(codec, ucontrol, spec->channel_mode, |
272 | spec->num_channel_mode, | 272 | spec->num_channel_mode, |
273 | &spec->multiout.max_channels); | 273 | &spec->multiout.max_channels); |
274 | if (! err && spec->need_dac_fix) | 274 | if (err >= 0 && spec->need_dac_fix) |
275 | spec->multiout.num_dacs = spec->multiout.max_channels / 2; | 275 | spec->multiout.num_dacs = spec->multiout.max_channels / 2; |
276 | return err; | 276 | return err; |
277 | } | 277 | } |