Skip to content

Commit ee0761d

Browse files
lztotiwai
authored andcommitted
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]>
1 parent 1e9eb5c commit ee0761d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sound/pci/ca0106/ca0106_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,8 @@ static int snd_ca0106_pcm_power_dac(struct snd_ca0106 *chip, int channel_id,
537537
else
538538
/* Power down */
539539
chip->spi_dac_reg[reg] |= bit;
540-
return snd_ca0106_spi_write(chip, chip->spi_dac_reg[reg]);
540+
if (snd_ca0106_spi_write(chip, chip->spi_dac_reg[reg]) != 0)
541+
return -ENXIO;
541542
}
542543
return 0;
543544
}

0 commit comments

Comments
 (0)