Commit 897f7847 authored by Mark Brown's avatar Mark Brown

ASoC: Convert wm9081 driver to use devm_kzalloc()

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 5fe803f5
...@@ -1361,7 +1361,8 @@ static __devinit int wm9081_i2c_probe(struct i2c_client *i2c, ...@@ -1361,7 +1361,8 @@ static __devinit int wm9081_i2c_probe(struct i2c_client *i2c,
unsigned int reg; unsigned int reg;
int ret; int ret;
wm9081 = kzalloc(sizeof(struct wm9081_priv), GFP_KERNEL); wm9081 = devm_kzalloc(&i2c->dev, sizeof(struct wm9081_priv),
GFP_KERNEL);
if (wm9081 == NULL) if (wm9081 == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -1405,7 +1406,6 @@ static __devinit int wm9081_i2c_probe(struct i2c_client *i2c, ...@@ -1405,7 +1406,6 @@ static __devinit int wm9081_i2c_probe(struct i2c_client *i2c,
err_regmap: err_regmap:
regmap_exit(wm9081->regmap); regmap_exit(wm9081->regmap);
err: err:
kfree(wm9081);
return ret; return ret;
} }
...@@ -1416,7 +1416,6 @@ static __devexit int wm9081_i2c_remove(struct i2c_client *client) ...@@ -1416,7 +1416,6 @@ static __devexit int wm9081_i2c_remove(struct i2c_client *client)
snd_soc_unregister_codec(&client->dev); snd_soc_unregister_codec(&client->dev);
regmap_exit(wm9081->regmap); regmap_exit(wm9081->regmap);
kfree(i2c_get_clientdata(client));
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment