All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: <broonie@kernel.org>
Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org,
	james.schulman@cirrus.com, lgirdwood@gmail.com,
	david.rhodes@cirrus.com
Subject: [PATCH 4/6] ASoC: cs35l41: Don't overwrite returned error code
Date: Tue, 14 Sep 2021 15:13:47 +0100	[thread overview]
Message-ID: <20210914141349.30218-4-ckeepax@opensource.cirrus.com> (raw)
In-Reply-To: <20210914141349.30218-1-ckeepax@opensource.cirrus.com>

In multiple places the driver overwrites the error code returned with
a static error code, this is not helpful for debugging. Update to pass
the error codes straight through.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
 sound/soc/codecs/cs35l41.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/sound/soc/codecs/cs35l41.c b/sound/soc/codecs/cs35l41.c
index ce652a454dfc8..0d7073bb313ab 100644
--- a/sound/soc/codecs/cs35l41.c
+++ b/sound/soc/codecs/cs35l41.c
@@ -317,7 +317,6 @@ static int cs35l41_otp_unpack(void *data)
 	ret = regmap_read(cs35l41->regmap, CS35L41_OTPID, &otp_id_reg);
 	if (ret < 0) {
 		dev_err(cs35l41->dev, "Read OTP ID failed\n");
-		ret = -EINVAL;
 		goto err_otp_unpack;
 	}
 
@@ -337,7 +336,6 @@ static int cs35l41_otp_unpack(void *data)
 						CS35L41_OTP_SIZE_WORDS);
 	if (ret < 0) {
 		dev_err(cs35l41->dev, "Read OTP Mem failed\n");
-		ret = -EINVAL;
 		goto err_otp_unpack;
 	}
 
@@ -352,13 +350,11 @@ static int cs35l41_otp_unpack(void *data)
 	ret = regmap_write(cs35l41->regmap, CS35L41_TEST_KEY_CTL, 0x00000055);
 	if (ret < 0) {
 		dev_err(cs35l41->dev, "Write Unlock key failed 1/2\n");
-		ret = -EINVAL;
 		goto err_otp_unpack;
 	}
 	ret = regmap_write(cs35l41->regmap, CS35L41_TEST_KEY_CTL, 0x000000AA);
 	if (ret < 0) {
 		dev_err(cs35l41->dev, "Write Unlock key failed 2/2\n");
-		ret = -EINVAL;
 		goto err_otp_unpack;
 	}
 
@@ -398,7 +394,6 @@ static int cs35l41_otp_unpack(void *data)
 						otp_val << otp_map[i].shift);
 			if (ret < 0) {
 				dev_err(cs35l41->dev, "Write OTP val failed\n");
-				ret = -EINVAL;
 				goto err_otp_unpack;
 			}
 		}
@@ -407,13 +402,11 @@ static int cs35l41_otp_unpack(void *data)
 	ret = regmap_write(cs35l41->regmap, CS35L41_TEST_KEY_CTL, 0x000000CC);
 	if (ret < 0) {
 		dev_err(cs35l41->dev, "Write Lock key failed 1/2\n");
-		ret = -EINVAL;
 		goto err_otp_unpack;
 	}
 	ret = regmap_write(cs35l41->regmap, CS35L41_TEST_KEY_CTL, 0x00000033);
 	if (ret < 0) {
 		dev_err(cs35l41->dev, "Write Lock key failed 2/2\n");
-		ret = -EINVAL;
 		goto err_otp_unpack;
 	}
 	ret = 0;
@@ -1413,7 +1406,6 @@ int cs35l41_probe(struct cs35l41_private *cs35l41,
 	/* CS35L41 needs INT for PDN_DONE */
 	if (ret != 0) {
 		dev_err(cs35l41->dev, "Failed to request IRQ: %d\n", ret);
-		ret = -ENODEV;
 		goto err;
 	}
 
-- 
2.11.0


  parent reply	other threads:[~2021-09-14 14:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-14 14:13 [PATCH 1/6] ASoC: cs35l41: Fix use of an uninitialised variable Charles Keepax
2021-09-14 14:13 ` [PATCH 2/6] ASoC: cs35l41: Use regmap_read_poll_timeout to wait for OTP boot Charles Keepax
2021-09-14 14:13 ` [PATCH 3/6] ASoC: cs35l41: Combine adjacent register writes Charles Keepax
2021-09-14 14:13 ` Charles Keepax [this message]
2021-09-14 14:13 ` [PATCH 5/6] ASoC: cs35l41: Fixup the error messages Charles Keepax
2021-09-14 14:13 ` [PATCH 6/6] ASoC: cs35l41: Fix a bunch of trivial code formating/style issues Charles Keepax
2021-09-14 14:23   ` Mark Brown
2021-09-15 10:53     ` Charles Keepax
2021-09-15 11:38       ` Mark Brown
2021-09-15 15:21 ` [PATCH 1/6] ASoC: cs35l41: Fix use of an uninitialised variable Mark Brown

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=20210914141349.30218-4-ckeepax@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=david.rhodes@cirrus.com \
    --cc=james.schulman@cirrus.com \
    --cc=lgirdwood@gmail.com \
    --cc=patches@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 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.