diff options
author | Tong Zhang <[email protected]> | 2020-08-24 18:45:41 -0400 |
---|---|---|
committer | Takashi Iwai <[email protected]> | 2020-08-25 09:27:49 +0200 |
commit | ee0761d1d8222bcc5c86bf10849dc86cf008557c (patch) | |
tree | ea3421cd3adf2e6a42895ca94af437d277a5b337 | |
parent | 1e9eb5c0907600926b81b0ac8317e85f240e8e1c (diff) |
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: Tong Zhang <[email protected]>
Cc: <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
-rw-r--r-- | sound/pci/ca0106/ca0106_main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index 70d775ff967e..c189f70c82cb 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c @@ -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; } |