]> Git Repo - linux.git/commitdiff
ALSA: hda: cs35l41: Correct error condition handling
authorVitaly Rodionov <[email protected]>
Mon, 13 Feb 2023 14:50:06 +0000 (14:50 +0000)
committerTakashi Iwai <[email protected]>
Tue, 14 Feb 2023 14:06:13 +0000 (15:06 +0100)
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: 7406bdbc4fb8 ("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]>
sound/pci/hda/hda_cs_dsp_ctl.c

index 5433f6227ac9f8ff7e66f8699a566cffaa4b1b56..463ca06036bfe7681992b72128f2de67b467d7da 100644 (file)
@@ -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;
This page took 0.055247 seconds and 4 git commands to generate.