aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/max98090.c
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2013-02-18 06:32:11 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-03-03 22:13:14 -0500
commita3a6cc84652d82ff795c519c6187d37baa1d9697 (patch)
tree03a12856489e434b6c863dc634e1b6ae8cf8d0da /sound/soc/codecs/max98090.c
parentf314cbe84fd81082a286af685c59c2dc4048bc77 (diff)
ASoC: max98090: Convert to devm_regmap_init_i2c()
devm_regmap_init_i2c() is device managed and makes error handling and code cleanup simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/max98090.c')
-rwxr-xr-xsound/soc/codecs/max98090.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 9ea73aa71198..fef370e03305 100755
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2322,7 +2322,7 @@ static int max98090_i2c_probe(struct i2c_client *i2c,
2322 max98090->pdata = i2c->dev.platform_data; 2322 max98090->pdata = i2c->dev.platform_data;
2323 max98090->irq = i2c->irq; 2323 max98090->irq = i2c->irq;
2324 2324
2325 max98090->regmap = regmap_init_i2c(i2c, &max98090_regmap); 2325 max98090->regmap = devm_regmap_init_i2c(i2c, &max98090_regmap);
2326 if (IS_ERR(max98090->regmap)) { 2326 if (IS_ERR(max98090->regmap)) {
2327 ret = PTR_ERR(max98090->regmap); 2327 ret = PTR_ERR(max98090->regmap);
2328 dev_err(&i2c->dev, "Failed to allocate regmap: %d\n", ret); 2328 dev_err(&i2c->dev, "Failed to allocate regmap: %d\n", ret);
@@ -2332,18 +2332,13 @@ static int max98090_i2c_probe(struct i2c_client *i2c,
2332 ret = snd_soc_register_codec(&i2c->dev, 2332 ret = snd_soc_register_codec(&i2c->dev,
2333 &soc_codec_dev_max98090, max98090_dai, 2333 &soc_codec_dev_max98090, max98090_dai,
2334 ARRAY_SIZE(max98090_dai)); 2334 ARRAY_SIZE(max98090_dai));
2335 if (ret < 0)
2336 regmap_exit(max98090->regmap);
2337
2338err_enable: 2335err_enable:
2339 return ret; 2336 return ret;
2340} 2337}
2341 2338
2342static int max98090_i2c_remove(struct i2c_client *client) 2339static int max98090_i2c_remove(struct i2c_client *client)
2343{ 2340{
2344 struct max98090_priv *max98090 = dev_get_drvdata(&client->dev);
2345 snd_soc_unregister_codec(&client->dev); 2341 snd_soc_unregister_codec(&client->dev);
2346 regmap_exit(max98090->regmap);
2347 return 0; 2342 return 0;
2348} 2343}
2349 2344