ASoC: rt5645: Fix the error handling of rt5645_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-4-zheyuma97@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Zheyu Ma 2022-05-10 23:32:48 +08:00 committed by Mark Brown
parent cf7250e95d
commit 7883c193d7
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 2 additions and 2 deletions

View File

@ -3943,7 +3943,7 @@ static int rt5645_i2c_probe(struct i2c_client *i2c)
ret = PTR_ERR(regmap);
dev_err(&i2c->dev, "Failed to allocate temp register map: %d\n",
ret);
return ret;
goto err_enable;
}
/*
@ -3974,7 +3974,7 @@ static int rt5645_i2c_probe(struct i2c_client *i2c)
ret = PTR_ERR(rt5645->regmap);
dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
ret);
return ret;
goto err_enable;
}
regmap_write(rt5645->regmap, RT5645_RESET, 0);