Commit ee0761d1 authored by Tong Zhang's avatar Tong Zhang Committed by Takashi Iwai

ALSA: ca0106: fix error code handling

snd_ca0106_spi_write() returns 1 on error, snd_ca0106_pcm_power_dac()
is returning the error code directly, and the caller is expecting an
negative error code
Signed-off-by: default avatarTong Zhang <ztong0001@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200824224541.1260307-1-ztong0001@gmail.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 1e9eb5c0
......@@ -537,7 +537,8 @@ static int snd_ca0106_pcm_power_dac(struct snd_ca0106 *chip, int channel_id,
else
/* Power down */
chip->spi_dac_reg[reg] |= bit;
return snd_ca0106_spi_write(chip, chip->spi_dac_reg[reg]);
if (snd_ca0106_spi_write(chip, chip->spi_dac_reg[reg]) != 0)
return -ENXIO;
}
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment