Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c5e6f5fa authored by Sachin Kamat's avatar Sachin Kamat Committed by Mark Brown
Browse files

ASoC: wm8960: Use devm_regmap_init_i2c()



devm_regmap_init_i2c() is device managed and makes error
handling and code cleanup simpler. There was no explicit
regmap_exit call in this function which was probably a bug.

Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 9489e9dc
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1040,7 +1040,7 @@ static __devinit int wm8960_i2c_probe(struct i2c_client *i2c,
	if (wm8960 == NULL)
	if (wm8960 == NULL)
		return -ENOMEM;
		return -ENOMEM;


	wm8960->regmap = regmap_init_i2c(i2c, &wm8960_regmap);
	wm8960->regmap = devm_regmap_init_i2c(i2c, &wm8960_regmap);
	if (IS_ERR(wm8960->regmap))
	if (IS_ERR(wm8960->regmap))
		return PTR_ERR(wm8960->regmap);
		return PTR_ERR(wm8960->regmap);