ASoC: wm8960: Use devm_regmap_init_i2c()
authorSachin Kamat <sachin.kamat@linaro.org>
Mon, 26 Nov 2012 11:49:43 +0000 (17:19 +0530)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 2 Dec 2012 04:09:51 +0000 (13:09 +0900)
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: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/codecs/wm8960.c

index f0f6f66017859c7e8b5fcab1f470565d8a6cdd88..cf09cb625a7b881edf3e14ca3ed1acd01b2557a8 100644 (file)
@@ -1040,7 +1040,7 @@ static __devinit int wm8960_i2c_probe(struct i2c_client *i2c,
        if (wm8960 == NULL)
                return -ENOMEM;
 
-       wm8960->regmap = regmap_init_i2c(i2c, &wm8960_regmap);
+       wm8960->regmap = devm_regmap_init_i2c(i2c, &wm8960_regmap);
        if (IS_ERR(wm8960->regmap))
                return PTR_ERR(wm8960->regmap);