aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZheyu Ma <zheyuma97@gmail.com>2022-05-10 23:32:50 +0800
committerMark Brown <broonie@kernel.org>2022-05-11 17:40:16 +0100
commit68cacb5cf5cf04aaa95be1fd76eff728dfddc613 (patch)
treebac161f71b844cf46d9669d4f7228501da5fb57e
parentASoC: tas571x: Fix the error handling of tas571x_i2c_probe() (diff)
downloadlinux-dev-68cacb5cf5cf04aaa95be1fd76eff728dfddc613.tar.xz
linux-dev-68cacb5cf5cf04aaa95be1fd76eff728dfddc613.zip
ASoC: tas6424: Fix the error handling of tas6424_i2c_probe()
After enabling the regulator, The driver should disable the regulator when failing at probing. Signed-off-by: Zheyu Ma <zheyuma97@gmail.com> Link: https://lore.kernel.org/r/20220510153251.1741210-6-zheyuma97@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/tas6424.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/soc/codecs/tas6424.c b/sound/soc/codecs/tas6424.c
index d87444efed37..22b53856e691 100644
--- a/sound/soc/codecs/tas6424.c
+++ b/sound/soc/codecs/tas6424.c
@@ -756,7 +756,7 @@ static int tas6424_i2c_probe(struct i2c_client *client)
TAS6424_RESET, TAS6424_RESET);
if (ret) {
dev_err(dev, "unable to reset device: %d\n", ret);
- return ret;
+ goto disable_regs;
}
INIT_DELAYED_WORK(&tas6424->fault_check_work, tas6424_fault_check_work);
@@ -765,10 +765,14 @@ static int tas6424_i2c_probe(struct i2c_client *client)
tas6424_dai, ARRAY_SIZE(tas6424_dai));
if (ret < 0) {
dev_err(dev, "unable to register codec: %d\n", ret);
- return ret;
+ goto disable_regs;
}
return 0;
+
+disable_regs:
+ regulator_bulk_disable(ARRAY_SIZE(tas6424->supplies), tas6424->supplies);
+ return ret;
}
static int tas6424_i2c_remove(struct i2c_client *client)