Skip to content

Commit

Permalink
ASoC: Convert wm8993 to devm_kzalloc()
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Dec 14, 2011
1 parent ffbf2a3 commit f6a9336
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sound/soc/codecs/wm8993.c
Original file line number Diff line number Diff line change
Expand Up @@ -1613,16 +1613,15 @@ static __devinit int wm8993_i2c_probe(struct i2c_client *i2c,
struct wm8993_priv *wm8993;
int ret;

wm8993 = kzalloc(sizeof(struct wm8993_priv), GFP_KERNEL);
wm8993 = devm_kzalloc(&i2c-dev, sizeof(struct wm8993_priv),
GFP_KERNEL);
if (wm8993 == NULL)
return -ENOMEM;

i2c_set_clientdata(i2c, wm8993);

ret = snd_soc_register_codec(&i2c->dev,
&soc_codec_dev_wm8993, &wm8993_dai, 1);
if (ret < 0)
kfree(wm8993);
return ret;
}

Expand Down

0 comments on commit f6a9336

Please sign in to comment.