public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stefan Binding <sbinding@opensource.cirrus.com>
To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>
Cc: <alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>,
	<patches@opensource.cirrus.com>,
	Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Subject: [PATCH v1 1/3] ALSA: hda/cs35l41: Fix error condition check
Date: Thu, 9 Feb 2023 16:04:01 +0000	[thread overview]
Message-ID: <20230209160403.838326-2-sbinding@opensource.cirrus.com> (raw)
In-Reply-To: <20230209160403.838326-1-sbinding@opensource.cirrus.com>

From: Vitaly Rodionov <vitalyr@opensource.cirrus.com>

Function hda_cs_dsp_write_ctl() returns 3 possible values:
0 - no change, 1 - value has changed and -1 - error, so value 1
is not an error.

Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
---
 sound/pci/hda/cs35l41_hda.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c
index f7815ee24f83..4dc57454201e 100644
--- a/sound/pci/hda/cs35l41_hda.c
+++ b/sound/pci/hda/cs35l41_hda.c
@@ -316,27 +316,27 @@ static int cs35l41_apply_calibration(struct cs35l41_hda *cs35l41, unsigned int a
 
 	ret = hda_cs_dsp_write_ctl(&cs35l41->cs_dsp, CAL_AMBIENT_DSP_CTL_NAME, CAL_DSP_CTL_TYPE,
 				   CAL_DSP_CTL_ALG, &ambient, 4);
-	if (ret) {
+	if (ret < 0) {
 		dev_err(cs35l41->dev, "Cannot Write Control: %s - %d\n", CAL_AMBIENT_DSP_CTL_NAME,
 			ret);
 		return ret;
 	}
 	ret = hda_cs_dsp_write_ctl(&cs35l41->cs_dsp, CAL_R_DSP_CTL_NAME, CAL_DSP_CTL_TYPE,
 				   CAL_DSP_CTL_ALG, &r0, 4);
-	if (ret) {
+	if (ret < 0) {
 		dev_err(cs35l41->dev, "Cannot Write Control: %s - %d\n", CAL_R_DSP_CTL_NAME, ret);
 		return ret;
 	}
 	ret = hda_cs_dsp_write_ctl(&cs35l41->cs_dsp, CAL_STATUS_DSP_CTL_NAME, CAL_DSP_CTL_TYPE,
 				   CAL_DSP_CTL_ALG, &status, 4);
-	if (ret) {
+	if (ret < 0) {
 		dev_err(cs35l41->dev, "Cannot Write Control: %s - %d\n", CAL_STATUS_DSP_CTL_NAME,
 			ret);
 		return ret;
 	}
 	ret = hda_cs_dsp_write_ctl(&cs35l41->cs_dsp, CAL_CHECKSUM_DSP_CTL_NAME, CAL_DSP_CTL_TYPE,
 				   CAL_DSP_CTL_ALG, &checksum, 4);
-	if (ret) {
+	if (ret < 0) {
 		dev_err(cs35l41->dev, "Cannot Write Control: %s - %d\n", CAL_CHECKSUM_DSP_CTL_NAME,
 			ret);
 		return ret;
-- 
2.34.1


  reply	other threads:[~2023-02-09 16:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09 16:04 [PATCH v1 0/3] Various Fixes/Improvements for CS35L41 HDA Stefan Binding
2023-02-09 16:04 ` Stefan Binding [this message]
2023-02-10  9:10   ` [PATCH v1 1/3] ALSA: hda/cs35l41: Fix error condition check Takashi Iwai
2023-02-09 16:04 ` [PATCH v1 2/3] ALSA: hda: cs35l41: Ensure firmware/tuning pairs are always loaded Stefan Binding
2023-02-09 16:04 ` [PATCH v1 3/3] ALSA: hda: cs35l41: Enable Amp High Pass Filter Stefan Binding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230209160403.838326-2-sbinding@opensource.cirrus.com \
    --to=sbinding@opensource.cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=vitalyr@opensource.cirrus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox