Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd2033f2 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela
Browse files

[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: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent d9301263
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}
+1 −1
Original line number Diff line number Diff line
@@ -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;
}