summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2012-11-26 17:19:35 +0530
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-11-28 17:39:13 +0000
commit92437cbb1bbcc4fd04a00d3d734ee7006e183a03 (patch)
tree2749ec61ae161db5884dd4607a8ae94cf79e6316 /sound
parent9489e9dcae718d5fde988e4a684a0f55b5f94d17 (diff)
downloadtalos-op-linux-92437cbb1bbcc4fd04a00d3d734ee7006e183a03.tar.gz
talos-op-linux-92437cbb1bbcc4fd04a00d3d734ee7006e183a03.zip
ASoC: wm8962: Use devm_regulator_bulk_get
devm_regulator_bulk_get() 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')
-rw-r--r--sound/soc/codecs/wm8962.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index ce6720073798..285a9ef6d8ed 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -3610,7 +3610,7 @@ static __devinit int wm8962_i2c_probe(struct i2c_client *i2c,
for (i = 0; i < ARRAY_SIZE(wm8962->supplies); i++)
wm8962->supplies[i].supply = wm8962_supply_names[i];
- ret = regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8962->supplies),
+ ret = devm_regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8962->supplies),
wm8962->supplies);
if (ret != 0) {
dev_err(&i2c->dev, "Failed to request supplies: %d\n", ret);
@@ -3621,7 +3621,7 @@ static __devinit int wm8962_i2c_probe(struct i2c_client *i2c,
wm8962->supplies);
if (ret != 0) {
dev_err(&i2c->dev, "Failed to enable supplies: %d\n", ret);
- goto err_get;
+ return ret;
}
wm8962->regmap = regmap_init_i2c(i2c, &wm8962_regmap);
@@ -3697,8 +3697,6 @@ err_regmap:
regmap_exit(wm8962->regmap);
err_enable:
regulator_bulk_disable(ARRAY_SIZE(wm8962->supplies), wm8962->supplies);
-err_get:
- regulator_bulk_free(ARRAY_SIZE(wm8962->supplies), wm8962->supplies);
err:
return ret;
}
@@ -3709,7 +3707,6 @@ static __devexit int wm8962_i2c_remove(struct i2c_client *client)
snd_soc_unregister_codec(&client->dev);
regmap_exit(wm8962->regmap);
- regulator_bulk_free(ARRAY_SIZE(wm8962->supplies), wm8962->supplies);
return 0;
}
OpenPOWER on IntegriCloud