diff mbox series

[2/6] ASoC: cs35l36: Fix the error handling of cs35l36_i2c_probe()

Message ID 20220510153251.1741210-3-zheyuma97@gmail.com
State Accepted
Commit cf7250e95d309ae518918613fb904a4565ffc85d
Headers show
Series ASOC: Fix the error handling code of the probe | expand

Commit Message

Zheyu Ma May 10, 2022, 3:32 p.m. UTC
The driver should goto label 'err' when failing at regmap_read().

Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
---
 sound/soc/codecs/cs35l36.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Charles Keepax May 10, 2022, 3:55 p.m. UTC | #1
On Tue, May 10, 2022 at 11:32:47PM +0800, Zheyu Ma wrote:
> The driver should goto label 'err' when failing at regmap_read().
> 
> Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
> ---

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles
diff mbox series

Patch

diff --git a/sound/soc/codecs/cs35l36.c b/sound/soc/codecs/cs35l36.c
index cc5e80222916..920190daa4d1 100644
--- a/sound/soc/codecs/cs35l36.c
+++ b/sound/soc/codecs/cs35l36.c
@@ -1803,7 +1803,7 @@  static int cs35l36_i2c_probe(struct i2c_client *i2c_client)
 	if (ret < 0) {
 		dev_err(&i2c_client->dev, "Failed to read otp_id Register %d\n",
 			ret);
-		return ret;
+		goto err;
 	}
 
 	if ((l37_id_reg & CS35L36_OTP_REV_MASK) == CS35L36_OTP_REV_L37)