diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2012-11-26 17:19:39 +0530 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-11-28 17:43:02 +0000 |
commit | 4e75955d8fcc59813483bab0c80473c8c4a6f04a (patch) | |
tree | caa79e842719dfab986ccef9e54f0d2856bff8de /sound/soc/codecs/da7210.c | |
parent | 9489e9dcae718d5fde988e4a684a0f55b5f94d17 (diff) | |
download | linux-4e75955d8fcc59813483bab0c80473c8c4a6f04a.tar.gz linux-4e75955d8fcc59813483bab0c80473c8c4a6f04a.tar.xz |
ASoC: da7210: Use 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/da7210.c')
-rw-r--r-- | sound/soc/codecs/da7210.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/sound/soc/codecs/da7210.c b/sound/soc/codecs/da7210.c index af5db7080519..ab1ee5b734db 100644 --- a/sound/soc/codecs/da7210.c +++ b/sound/soc/codecs/da7210.c @@ -1231,7 +1231,7 @@ static int __devinit da7210_i2c_probe(struct i2c_client *i2c, i2c_set_clientdata(i2c, da7210); - da7210->regmap = regmap_init_i2c(i2c, &da7210_regmap_config_i2c); + da7210->regmap = devm_regmap_init_i2c(i2c, &da7210_regmap_config_i2c); if (IS_ERR(da7210->regmap)) { ret = PTR_ERR(da7210->regmap); dev_err(&i2c->dev, "regmap_init() failed: %d\n", ret); @@ -1245,24 +1245,15 @@ static int __devinit da7210_i2c_probe(struct i2c_client *i2c, ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_da7210, &da7210_dai, 1); - if (ret < 0) { + if (ret < 0) dev_err(&i2c->dev, "Failed to register codec: %d\n", ret); - goto err_regmap; - } - return ret; - -err_regmap: - regmap_exit(da7210->regmap); return ret; } static int __devexit da7210_i2c_remove(struct i2c_client *client) { - struct da7210_priv *da7210 = i2c_get_clientdata(client); - snd_soc_unregister_codec(&client->dev); - regmap_exit(da7210->regmap); return 0; } |