Skip to content

Commit

Permalink
ALSA: hda: cs35l41: Correct error condition handling
Browse files Browse the repository at this point in the history
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 <vitalyr@opensource.cirrus.com>
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230213145008.1215849-2-sbinding@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Vitaly Rodionov authored and Takashi Iwai committed Feb 14, 2023
1 parent aacdac3 commit 943f4e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/pci/hda/hda_cs_dsp_ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ int hda_cs_dsp_write_ctl(struct cs_dsp *dsp, const char *name, int type,
cs_ctl = cs_dsp_get_ctl(dsp, name, type, alg);
ret = cs_dsp_coeff_write_ctrl(cs_ctl, 0, buf, len);
mutex_unlock(&dsp->pwr_lock);
if (ret)
if (ret < 0)
return ret;

if (cs_ctl->flags & WMFW_CTL_FLAG_SYS)
if (ret == 0 || (cs_ctl->flags & WMFW_CTL_FLAG_SYS))
return 0;

ctl = cs_ctl->priv;
Expand Down

0 comments on commit 943f4e6

Please sign in to comment.