Skip to content

Commit 943f4e6

Browse files
Vitaly Rodionovtiwai
authored andcommitted
ALSA: hda: cs35l41: Correct error condition handling
Function cs_dsp_coeff_write_ctrl() can return 3 possible values: 0 - no change, 1 - value has changed and -1 - error, so positive value is not an error. Fixes: 7406bdb ("ASoC: wm_adsp: Return whether changed when writing controls") Signed-off-by: Vitaly Rodionov <[email protected]> Signed-off-by: Stefan Binding <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent aacdac3 commit 943f4e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/pci/hda/hda_cs_dsp_ctl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,10 @@ int hda_cs_dsp_write_ctl(struct cs_dsp *dsp, const char *name, int type,
218218
cs_ctl = cs_dsp_get_ctl(dsp, name, type, alg);
219219
ret = cs_dsp_coeff_write_ctrl(cs_ctl, 0, buf, len);
220220
mutex_unlock(&dsp->pwr_lock);
221-
if (ret)
221+
if (ret < 0)
222222
return ret;
223223

224-
if (cs_ctl->flags & WMFW_CTL_FLAG_SYS)
224+
if (ret == 0 || (cs_ctl->flags & WMFW_CTL_FLAG_SYS))
225225
return 0;
226226

227227
ctl = cs_ctl->priv;

0 commit comments

Comments
 (0)