aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-01 23:35:28 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-01 23:35:28 -0500
commite041e46907d2abaef8719f33379d3be4886c7088 (patch)
tree4c276e8728309719a5d882f3cd84c000d1e0f77c /sound
parent84b043d5495d8baf767151feb0aecf0839f52239 (diff)
parent6dff9b3b05f21a7b8e20916d521f17a5715d7688 (diff)
Merge remote-tracking branch 'asoc/topic/wm8993' into asoc-next
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wm8993.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/sound/soc/codecs/wm8993.c b/sound/soc/codecs/wm8993.c
index 94737a30716b..347a359a7c86 100644
--- a/sound/soc/codecs/wm8993.c
+++ b/sound/soc/codecs/wm8993.c
@@ -1660,7 +1660,7 @@ static __devinit int wm8993_i2c_probe(struct i2c_client *i2c,
1660 wm8993->dev = &i2c->dev; 1660 wm8993->dev = &i2c->dev;
1661 init_completion(&wm8993->fll_lock); 1661 init_completion(&wm8993->fll_lock);
1662 1662
1663 wm8993->regmap = regmap_init_i2c(i2c, &wm8993_regmap); 1663 wm8993->regmap = devm_regmap_init_i2c(i2c, &wm8993_regmap);
1664 if (IS_ERR(wm8993->regmap)) { 1664 if (IS_ERR(wm8993->regmap)) {
1665 ret = PTR_ERR(wm8993->regmap); 1665 ret = PTR_ERR(wm8993->regmap);
1666 dev_err(&i2c->dev, "Failed to allocate regmap: %d\n", ret); 1666 dev_err(&i2c->dev, "Failed to allocate regmap: %d\n", ret);
@@ -1672,18 +1672,18 @@ 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);
1679 goto err; 1679 return ret;
1680 } 1680 }
1681 1681
1682 ret = regulator_bulk_enable(ARRAY_SIZE(wm8993->supplies), 1682 ret = regulator_bulk_enable(ARRAY_SIZE(wm8993->supplies),
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 return ret;
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,10 +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:
1748 regmap_exit(wm8993->regmap);
1749 return ret; 1745 return ret;
1750} 1746}
1751 1747
@@ -1756,9 +1752,7 @@ static __devexit int wm8993_i2c_remove(struct i2c_client *i2c)
1756 snd_soc_unregister_codec(&i2c->dev); 1752 snd_soc_unregister_codec(&i2c->dev);
1757 if (i2c->irq) 1753 if (i2c->irq)
1758 free_irq(i2c->irq, wm8993); 1754 free_irq(i2c->irq, wm8993);
1759 regmap_exit(wm8993->regmap);
1760 regulator_bulk_disable(ARRAY_SIZE(wm8993->supplies), wm8993->supplies); 1755 regulator_bulk_disable(ARRAY_SIZE(wm8993->supplies), wm8993->supplies);
1761 regulator_bulk_free(ARRAY_SIZE(wm8993->supplies), wm8993->supplies);
1762 1756
1763 return 0; 1757 return 0;
1764} 1758}