linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: ca0106: fix error code handling
@ 2020-08-24 22:45 Tong Zhang
  2020-08-25  7:27 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Tong Zhang @ 2020-08-24 22:45 UTC (permalink / raw)
  To: perex, tiwai, ztong0001, alsa-devel, linux-kernel

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 <ztong0001@gmail.com>
---
 sound/pci/ca0106/ca0106_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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;
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: ca0106: fix error code handling
  2020-08-24 22:45 [PATCH] ALSA: ca0106: fix error code handling Tong Zhang
@ 2020-08-25  7:27 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2020-08-25  7:27 UTC (permalink / raw)
  To: Tong Zhang; +Cc: perex, tiwai, alsa-devel, linux-kernel

On Tue, 25 Aug 2020 00:45:41 +0200,
Tong Zhang wrote:
> 
> 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 <ztong0001@gmail.com>

Thanks, applied with Cc to stable.


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-25  7:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-24 22:45 [PATCH] ALSA: ca0106: fix error code handling Tong Zhang
2020-08-25  7:27 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).