diff mbox series

[1/6] ASoC: cs42l52: Fix the error handling of cs42l56_i2c_probe()

Message ID 20220510153251.1741210-2-zheyuma97@gmail.com (mailing list archive)
State Accepted
Commit c1ce4ba5021a9730c00bab6f8122702deb69d37e
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_enable' when failing at regmap_read().

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

Comments

Charles Keepax May 10, 2022, 3:54 p.m. UTC | #1
On Tue, May 10, 2022 at 11:32:46PM +0800, Zheyu Ma wrote:
> The driver should goto label 'err_enable' when failing at regmap_read().
> 
> Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
> ---
>  sound/soc/codecs/cs42l56.c | 2 +-

Patch looks good but the subject line says cs42l52 instead of 56.

Thanks,
Charles
diff mbox series

Patch

diff --git a/sound/soc/codecs/cs42l56.c b/sound/soc/codecs/cs42l56.c
index 2c4e09b43199..dc23007336c5 100644
--- a/sound/soc/codecs/cs42l56.c
+++ b/sound/soc/codecs/cs42l56.c
@@ -1245,7 +1245,7 @@  static int cs42l56_i2c_probe(struct i2c_client *i2c_client)
 	ret = regmap_read(cs42l56->regmap, CS42L56_CHIP_ID_1, &reg);
 	if (ret) {
 		dev_err(&i2c_client->dev, "Failed to read chip ID: %d\n", ret);
-		return ret;
+		goto err_enable;
 	}
 
 	devid = reg & CS42L56_CHIP_ID_MASK;