Unverified Commit 68cacb5c authored by Zheyu Ma's avatar Zheyu Ma Committed by Mark Brown
Browse files

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: default avatarZheyu Ma <zheyuma97@gmail.com>
Link: https://lore.kernel.org/r/20220510153251.1741210-6-zheyuma97@gmail.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent ef1878fd
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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)