linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viorel Suman <viorel.suman@nxp.com>
To: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Viorel Suman <viorel.suman@nxp.com>,
	"S.j. Wang" <shengjiu.wang@nxp.com>,
	Julia Lawall <Julia.Lawall@lip6.fr>,
	Daniel Baluta <daniel.baluta@nxp.com>,
	Colin Ian King <colin.king@canonical.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: dl-linux-imx <linux-imx@nxp.com>, Viorel Suman <viorel.suman@gmail.com>
Subject: [PATCH 1/2] ASoC: ak4458: rstn_control - return a non-zero on error only
Date: Thu, 9 May 2019 13:30:36 +0000	[thread overview]
Message-ID: <1557408607-25115-2-git-send-email-viorel.suman@nxp.com> (raw)
In-Reply-To: <1557408607-25115-1-git-send-email-viorel.suman@nxp.com>

snd_soc_component_update_bits() may return 1 if operation
was successful and the value of the register changed.
Return a non-zero in ak4458_rstn_control for an error only.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
---
 sound/soc/codecs/ak4458.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/ak4458.c b/sound/soc/codecs/ak4458.c
index eab7c76..4795e32 100644
--- a/sound/soc/codecs/ak4458.c
+++ b/sound/soc/codecs/ak4458.c
@@ -304,7 +304,8 @@ static int ak4458_rstn_control(struct snd_soc_component *component, int bit)
 					  AK4458_00_CONTROL1,
 					  AK4458_RSTN_MASK,
 					  0x0);
-	return ret;
+	/* Return a negative error code only. */
+	return (ret < 0 ? ret : 0);
 }
 
 static int ak4458_hw_params(struct snd_pcm_substream *substream,
-- 
2.7.4


  reply	other threads:[~2019-05-09 13:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-09 13:30 [PATCH 0/2] ASoC: ak4458: fail on probe if codec is not present Viorel Suman
2019-05-09 13:30 ` Viorel Suman [this message]
2019-05-12  7:54   ` [PATCH 1/2] ASoC: ak4458: rstn_control - return a non-zero on error only Mark Brown
2019-05-09 13:30 ` [PATCH 2/2] ASoC: ak4458: add return value for ak4458_probe Viorel Suman

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=1557408607-25115-2-git-send-email-viorel.suman@nxp.com \
    --to=viorel.suman@nxp.com \
    --cc=Julia.Lawall@lip6.fr \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=colin.king@canonical.com \
    --cc=daniel.baluta@nxp.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=shengjiu.wang@nxp.com \
    --cc=tiwai@suse.com \
    --cc=viorel.suman@gmail.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;
as well as URLs for NNTP newsgroup(s).