diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-01-21 23:18:52 +0100 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-02-01 11:17:34 +0100 |
commit | 24e0c57b8ed2b3a9fe07c07edc1c0062df5be8bf (patch) | |
tree | df696cb9919da9dd8bc13d563dfe2757bea2745b /sound/soc/codecs/wm8996.c | |
parent | ASoC: wm8996: Switch to using common code for managing CPVDD supply (diff) | |
download | linux-24e0c57b8ed2b3a9fe07c07edc1c0062df5be8bf.tar.xz linux-24e0c57b8ed2b3a9fe07c07edc1c0062df5be8bf.zip |
ASoC: wm8996: Use devm_regulator_bulk_get()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8996.c')
-rw-r--r-- | sound/soc/codecs/wm8996.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c index 42af0a396839..10f41c888884 100644 --- a/sound/soc/codecs/wm8996.c +++ b/sound/soc/codecs/wm8996.c @@ -3153,8 +3153,8 @@ static __devinit int wm8996_i2c_probe(struct i2c_client *i2c, for (i = 0; i < ARRAY_SIZE(wm8996->supplies); i++) wm8996->supplies[i].supply = wm8996_supply_names[i]; - ret = regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8996->supplies), - wm8996->supplies); + ret = devm_regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8996->supplies), + wm8996->supplies); if (ret != 0) { dev_err(&i2c->dev, "Failed to request supplies: %d\n", ret); goto err_gpio; @@ -3164,7 +3164,7 @@ static __devinit int wm8996_i2c_probe(struct i2c_client *i2c, wm8996->supplies); if (ret != 0) { dev_err(&i2c->dev, "Failed to enable supplies: %d\n", ret); - goto err_get; + goto err_gpio; } if (wm8996->pdata.ldo_ena > 0) { @@ -3226,8 +3226,6 @@ err_enable: if (wm8996->pdata.ldo_ena > 0) gpio_set_value_cansleep(wm8996->pdata.ldo_ena, 0); regulator_bulk_disable(ARRAY_SIZE(wm8996->supplies), wm8996->supplies); -err_get: - regulator_bulk_free(ARRAY_SIZE(wm8996->supplies), wm8996->supplies); err_gpio: if (wm8996->pdata.ldo_ena > 0) gpio_free(wm8996->pdata.ldo_ena); @@ -3242,7 +3240,6 @@ static __devexit int wm8996_i2c_remove(struct i2c_client *client) snd_soc_unregister_codec(&client->dev); wm8996_free_gpio(wm8996); - regulator_bulk_free(ARRAY_SIZE(wm8996->supplies), wm8996->supplies); regmap_exit(wm8996->regmap); if (wm8996->pdata.ldo_ena > 0) { gpio_set_value_cansleep(wm8996->pdata.ldo_ena, 0); |