Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332063
b: refs/heads/master
c: 719b0c5
h: refs/heads/master
i:
  332061: 45281c3
  332059: 33ae77d
  332055: fb3cc41
  332047: 498bb00
  332031: 92ac686
v: v3
  • Loading branch information
Mark Brown committed Sep 10, 2012
1 parent 960515f commit 7bb46e1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7d014db8baf70bcc7e9cf1457350b11bc2affbbd
refs/heads/master: 719b0c593cbb2a199e977b4dcca1d096a4a0d6a7
26 changes: 12 additions & 14 deletions trunk/sound/soc/codecs/wm8523.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ static int wm8523_resume(struct snd_soc_codec *codec)
static int wm8523_probe(struct snd_soc_codec *codec)
{
struct wm8523_priv *wm8523 = snd_soc_codec_get_drvdata(codec);
int ret, i;
int ret;

wm8523->rate_constraint.list = &wm8523->rate_constraint_list[0];
wm8523->rate_constraint.count =
Expand All @@ -414,16 +414,6 @@ static int wm8523_probe(struct snd_soc_codec *codec)
return ret;
}

for (i = 0; i < ARRAY_SIZE(wm8523->supplies); i++)
wm8523->supplies[i].supply = wm8523_supply_names[i];

ret = regulator_bulk_get(codec->dev, ARRAY_SIZE(wm8523->supplies),
wm8523->supplies);
if (ret != 0) {
dev_err(codec->dev, "Failed to request supplies: %d\n", ret);
return ret;
}

ret = regulator_bulk_enable(ARRAY_SIZE(wm8523->supplies),
wm8523->supplies);
if (ret != 0) {
Expand Down Expand Up @@ -471,7 +461,6 @@ static int wm8523_probe(struct snd_soc_codec *codec)
err_enable:
regulator_bulk_disable(ARRAY_SIZE(wm8523->supplies), wm8523->supplies);
err_get:
regulator_bulk_free(ARRAY_SIZE(wm8523->supplies), wm8523->supplies);

return ret;
}
Expand All @@ -481,7 +470,6 @@ static int wm8523_remove(struct snd_soc_codec *codec)
struct wm8523_priv *wm8523 = snd_soc_codec_get_drvdata(codec);

wm8523_set_bias_level(codec, SND_SOC_BIAS_OFF);
regulator_bulk_free(ARRAY_SIZE(wm8523->supplies), wm8523->supplies);
return 0;
}

Expand Down Expand Up @@ -514,13 +502,23 @@ static __devinit int wm8523_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
struct wm8523_priv *wm8523;
int ret;
int ret, i;

wm8523 = devm_kzalloc(&i2c->dev, sizeof(struct wm8523_priv),
GFP_KERNEL);
if (wm8523 == NULL)
return -ENOMEM;

for (i = 0; i < ARRAY_SIZE(wm8523->supplies); i++)
wm8523->supplies[i].supply = wm8523_supply_names[i];

ret = devm_regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8523->supplies),
wm8523->supplies);
if (ret != 0) {
dev_err(&i2c->dev, "Failed to request supplies: %d\n", ret);
return ret;
}

i2c_set_clientdata(i2c, wm8523);
wm8523->control_type = SND_SOC_I2C;

Expand Down

0 comments on commit 7bb46e1

Please sign in to comment.