summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm9081.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-27 15:57:44 +0000
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-27 16:04:02 +0000
commit897f7847e6fec6f24efef4268993afcfc36dca23 (patch)
treefe954190029af967b2a5be6305b70a928182c4f1 /sound/soc/codecs/wm9081.c
parent5fe803f56ad41cf008399f71ee48280f0cf9732b (diff)
ASoC: Convert wm9081 driver to use devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm9081.c')
-rw-r--r--sound/soc/codecs/wm9081.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c
index ba126906f82c..8a4b97060444 100644
--- a/sound/soc/codecs/wm9081.c
+++ b/sound/soc/codecs/wm9081.c
@@ -1361,7 +1361,8 @@ static __devinit int wm9081_i2c_probe(struct i2c_client *i2c,
unsigned int reg;
int ret;
- wm9081 = kzalloc(sizeof(struct wm9081_priv), GFP_KERNEL);
+ wm9081 = devm_kzalloc(&i2c->dev, sizeof(struct wm9081_priv),
+ GFP_KERNEL);
if (wm9081 == NULL)
return -ENOMEM;
@@ -1405,7 +1406,6 @@ static __devinit int wm9081_i2c_probe(struct i2c_client *i2c,
err_regmap:
regmap_exit(wm9081->regmap);
err:
- kfree(wm9081);
return ret;
}
@@ -1416,7 +1416,6 @@ static __devexit int wm9081_i2c_remove(struct i2c_client *client)
snd_soc_unregister_codec(&client->dev);
regmap_exit(wm9081->regmap);
- kfree(i2c_get_clientdata(client));
return 0;
}