All of lore.kernel.org
 help / color / mirror / Atom feed
From: Raphael Poggi <poggi.raph@gmail.com>
To: perex@perex.cz, tiwai@suse.com
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	alsa-devel@alsa-project.org, Raphael Poggi <poggi.raph@gmail.com>
Subject: [PATCH 1/4] sound: codecs: pcm1792a: clean function exit
Date: Fri, 20 Nov 2015 11:09:14 +0100	[thread overview]
Message-ID: <1448014157-36526-2-git-send-email-raphael.poggi@avalun.com> (raw)
In-Reply-To: <1448014157-36526-1-git-send-email-raphael.poggi@avalun.com>

From: Raphael Poggi <poggi.raph@gmail.com>

Signed-off-by: Raphael Poggi <poggi.raph@gmail.com>
---
 sound/soc/codecs/pcm1792a.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/sound/soc/codecs/pcm1792a.c b/sound/soc/codecs/pcm1792a.c
index 08bb486..cf42b24 100644
--- a/sound/soc/codecs/pcm1792a.c
+++ b/sound/soc/codecs/pcm1792a.c
@@ -91,14 +91,9 @@ static int pcm1792a_digital_mute(struct snd_soc_dai *dai, int mute)
 {
 	struct snd_soc_codec *codec = dai->codec;
 	struct pcm1792a_private *priv = snd_soc_codec_get_drvdata(codec);
-	int ret;
 
-	ret = regmap_update_bits(priv->regmap, PCM1792A_SOFT_MUTE,
+	return regmap_update_bits(priv->regmap, PCM1792A_SOFT_MUTE,
 				 PCM1792A_MUTE_MASK, !!mute);
-	if (ret < 0)
-		return ret;
-
-	return 0;
 }
 
 static int pcm1792a_hw_params(struct snd_pcm_substream *substream,
@@ -107,7 +102,8 @@ static int pcm1792a_hw_params(struct snd_pcm_substream *substream,
 {
 	struct snd_soc_codec *codec = dai->codec;
 	struct pcm1792a_private *priv = snd_soc_codec_get_drvdata(codec);
-	int val = 0, ret;
+	int val = 0;
+	int ret = 0;
 
 	priv->rate = params_rate(params);
 
@@ -147,10 +143,8 @@ static int pcm1792a_hw_params(struct snd_pcm_substream *substream,
 
 	ret = regmap_update_bits(priv->regmap, PCM1792A_FMT_CONTROL,
 				 PCM1792A_FMT_MASK | PCM1792A_ATLD_ENABLE, val);
-	if (ret < 0)
-		return ret;
 
-	return 0;
+	return ret;
 }
 
 static const struct snd_soc_dai_ops pcm1792a_dai_ops = {
-- 
2.1.0


WARNING: multiple messages have this Message-ID (diff)
From: Raphael Poggi <poggi.raph-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: perex-/Fr2/VpizcU@public.gmane.org, tiwai-IBi9RG/b67k@public.gmane.org
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
	Raphael Poggi
	<poggi.raph-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH 1/4] sound: codecs: pcm1792a: clean function exit
Date: Fri, 20 Nov 2015 11:09:14 +0100	[thread overview]
Message-ID: <1448014157-36526-2-git-send-email-raphael.poggi@avalun.com> (raw)
In-Reply-To: <1448014157-36526-1-git-send-email-raphael.poggi-jXdF5569nj7QT0dZR+AlfA@public.gmane.org>

From: Raphael Poggi <poggi.raph-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Signed-off-by: Raphael Poggi <poggi.raph-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 sound/soc/codecs/pcm1792a.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/sound/soc/codecs/pcm1792a.c b/sound/soc/codecs/pcm1792a.c
index 08bb486..cf42b24 100644
--- a/sound/soc/codecs/pcm1792a.c
+++ b/sound/soc/codecs/pcm1792a.c
@@ -91,14 +91,9 @@ static int pcm1792a_digital_mute(struct snd_soc_dai *dai, int mute)
 {
 	struct snd_soc_codec *codec = dai->codec;
 	struct pcm1792a_private *priv = snd_soc_codec_get_drvdata(codec);
-	int ret;
 
-	ret = regmap_update_bits(priv->regmap, PCM1792A_SOFT_MUTE,
+	return regmap_update_bits(priv->regmap, PCM1792A_SOFT_MUTE,
 				 PCM1792A_MUTE_MASK, !!mute);
-	if (ret < 0)
-		return ret;
-
-	return 0;
 }
 
 static int pcm1792a_hw_params(struct snd_pcm_substream *substream,
@@ -107,7 +102,8 @@ static int pcm1792a_hw_params(struct snd_pcm_substream *substream,
 {
 	struct snd_soc_codec *codec = dai->codec;
 	struct pcm1792a_private *priv = snd_soc_codec_get_drvdata(codec);
-	int val = 0, ret;
+	int val = 0;
+	int ret = 0;
 
 	priv->rate = params_rate(params);
 
@@ -147,10 +143,8 @@ static int pcm1792a_hw_params(struct snd_pcm_substream *substream,
 
 	ret = regmap_update_bits(priv->regmap, PCM1792A_FMT_CONTROL,
 				 PCM1792A_FMT_MASK | PCM1792A_ATLD_ENABLE, val);
-	if (ret < 0)
-		return ret;
 
-	return 0;
+	return ret;
 }
 
 static const struct snd_soc_dai_ops pcm1792a_dai_ops = {
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2015-11-20 10:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20 10:09 [PATCH 0/4] New feature and clean up for pcm1792a driver Raphael Poggi
2015-11-20 10:09 ` Raphael Poggi [this message]
2015-11-20 10:09   ` [PATCH 1/4] sound: codecs: pcm1792a: clean function exit Raphael Poggi
2015-11-21  9:31   ` [alsa-devel] " Michael Trimarchi
2015-11-21  9:31     ` Michael Trimarchi
2015-11-21 16:16     ` Raphaël Poggi
2015-11-21 16:33       ` Michael Trimarchi
2015-11-21 16:33         ` Michael Trimarchi
2015-11-20 10:09 ` [PATCH 2/4] sound: codecs: pcm1792a: add define for register Raphael Poggi
2015-11-21  9:36   ` [alsa-devel] " Michael Trimarchi
2015-11-20 10:09 ` [PATCH 3/4] dt-bindings: sound: add binding for pcm1792a Raphael Poggi
2015-11-20 10:09   ` Raphael Poggi
2015-11-20 14:42   ` Rob Herring
2015-11-20 15:04     ` [alsa-devel] " Michael Trimarchi
2015-11-20 15:04       ` Michael Trimarchi
2015-11-20 10:09 ` [PATCH 4/4] sound: codecs: pcm1792a: introduce channel side Raphael Poggi
2015-11-21  9:37   ` [alsa-devel] " Michael Trimarchi
2015-11-21  9:37     ` Michael Trimarchi
2015-11-24  8:21     ` Raphaël Poggi
2015-11-24  8:27       ` Michael Trimarchi
2015-11-24 16:04         ` Raphaël Poggi
2015-11-24 16:04           ` Raphaël Poggi
2015-11-24 20:10           ` Michael Trimarchi

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=1448014157-36526-2-git-send-email-raphael.poggi@avalun.com \
    --to=poggi.raph@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.