aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2012-11-26 06:49:37 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-11-28 12:40:49 -0500
commit877fa971fb246f8ba9907e3a3b9fb5f00d934230 (patch)
tree466d4364b094dca6a751777b2bae3158778af5eb /sound
parent9489e9dcae718d5fde988e4a684a0f55b5f94d17 (diff)
ASoC: wm8993: 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/wm8993.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sound/soc/codecs/wm8993.c b/sound/soc/codecs/wm8993.c
index 94737a30716b..c3d31073eeeb 100644
--- a/sound/soc/codecs/wm8993.c
+++ b/sound/soc/codecs/wm8993.c
@@ -1672,7 +1672,7 @@ static __devinit int wm8993_i2c_probe(struct i2c_client *i2c,
1672 for (i = 0; i < ARRAY_SIZE(wm8993->supplies); i++) 1672 for (i = 0; i < ARRAY_SIZE(wm8993->supplies); i++)
1673 wm8993->supplies[i].supply = wm8993_supply_names[i]; 1673 wm8993->supplies[i].supply = wm8993_supply_names[i];
1674 1674
1675 ret = regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8993->supplies), 1675 ret = devm_regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8993->supplies),
1676 wm8993->supplies); 1676 wm8993->supplies);
1677 if (ret != 0) { 1677 if (ret != 0) {
1678 dev_err(&i2c->dev, "Failed to request supplies: %d\n", ret); 1678 dev_err(&i2c->dev, "Failed to request supplies: %d\n", ret);
@@ -1683,7 +1683,7 @@ static __devinit int wm8993_i2c_probe(struct i2c_client *i2c,
1683 wm8993->supplies); 1683 wm8993->supplies);
1684 if (ret != 0) { 1684 if (ret != 0) {
1685 dev_err(&i2c->dev, "Failed to enable supplies: %d\n", ret); 1685 dev_err(&i2c->dev, "Failed to enable supplies: %d\n", ret);
1686 goto err_get; 1686 goto err;
1687 } 1687 }
1688 1688
1689 ret = regmap_read(wm8993->regmap, WM8993_SOFTWARE_RESET, &reg); 1689 ret = regmap_read(wm8993->regmap, WM8993_SOFTWARE_RESET, &reg);
@@ -1742,8 +1742,6 @@ err_irq:
1742 free_irq(i2c->irq, wm8993); 1742 free_irq(i2c->irq, wm8993);
1743err_enable: 1743err_enable:
1744 regulator_bulk_disable(ARRAY_SIZE(wm8993->supplies), wm8993->supplies); 1744 regulator_bulk_disable(ARRAY_SIZE(wm8993->supplies), wm8993->supplies);
1745err_get:
1746 regulator_bulk_free(ARRAY_SIZE(wm8993->supplies), wm8993->supplies);
1747err: 1745err:
1748 regmap_exit(wm8993->regmap); 1746 regmap_exit(wm8993->regmap);
1749 return ret; 1747 return ret;
@@ -1758,7 +1756,6 @@ static __devexit int wm8993_i2c_remove(struct i2c_client *i2c)
1758 free_irq(i2c->irq, wm8993); 1756 free_irq(i2c->irq, wm8993);
1759 regmap_exit(wm8993->regmap); 1757 regmap_exit(wm8993->regmap);
1760 regulator_bulk_disable(ARRAY_SIZE(wm8993->supplies), wm8993->supplies); 1758 regulator_bulk_disable(ARRAY_SIZE(wm8993->supplies), wm8993->supplies);
1761 regulator_bulk_free(ARRAY_SIZE(wm8993->supplies), wm8993->supplies);
1762 1759
1763 return 0; 1760 return 0;
1764} 1761}