Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283863
b: refs/heads/master
c: b903c0e
h: refs/heads/master
i:
  283861: 0024dc6
  283859: 7328785
  283855: d4cb1e6
v: v3
  • Loading branch information
Mark Brown committed Dec 3, 2011
1 parent 5446594 commit 1fb855b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 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: 0d1fe0d4521436d8af2111045a682c4c8aa1b55d
refs/heads/master: b903c0ed2e85155c3a67cfc54117223a61bb483f
9 changes: 3 additions & 6 deletions trunk/sound/soc/codecs/wm8400.c
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,8 @@ static int wm8400_codec_probe(struct snd_soc_codec *codec)
int ret;
u16 reg;

priv = kzalloc(sizeof(struct wm8400_priv), GFP_KERNEL);
priv = devm_kzalloc(codec->dev, sizeof(struct wm8400_priv),
GFP_KERNEL);
if (priv == NULL)
return -ENOMEM;

Expand All @@ -1395,7 +1396,7 @@ static int wm8400_codec_probe(struct snd_soc_codec *codec)
ARRAY_SIZE(power), &power[0]);
if (ret != 0) {
dev_err(codec->dev, "Failed to get regulators: %d\n", ret);
goto err;
return ret;
}

INIT_WORK(&priv->work, wm8400_probe_deferred);
Expand Down Expand Up @@ -1426,22 +1427,18 @@ static int wm8400_codec_probe(struct snd_soc_codec *codec)

err_regulator:
regulator_bulk_free(ARRAY_SIZE(power), power);
err:
kfree(priv);
return ret;
}

static int wm8400_codec_remove(struct snd_soc_codec *codec)
{
struct wm8400_priv *priv = snd_soc_codec_get_drvdata(codec);
u16 reg;

reg = wm8400_read(codec, WM8400_POWER_MANAGEMENT_1);
wm8400_write(codec, WM8400_POWER_MANAGEMENT_1,
reg & (~WM8400_CODEC_ENA));

regulator_bulk_free(ARRAY_SIZE(power), power);
kfree(priv);

return 0;
}
Expand Down

0 comments on commit 1fb855b

Please sign in to comment.