summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/cs4270.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-12-29 07:58:22 +0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-01-02 16:28:13 +0400
commit7fd8a67446aded9d25e0ae1d94d19105f1620af5 (patch)
tree1c21a9698466bfc1a4324367a1c429599646484e /sound/soc/codecs/cs4270.c
parent360b70ca5e4668c9b9e24d8b200e7069bec83b4e (diff)
downloadlinux-7fd8a67446aded9d25e0ae1d94d19105f1620af5.tar.xz
ASoC: Convert cs4270 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/cs4270.c')
-rw-r--r--sound/soc/codecs/cs4270.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c
index fef0f48330e4..055536645da9 100644
--- a/sound/soc/codecs/cs4270.c
+++ b/sound/soc/codecs/cs4270.c
@@ -671,7 +671,8 @@ static int cs4270_i2c_probe(struct i2c_client *i2c_client,
i2c_client->addr);
dev_info(&i2c_client->dev, "hardware revision %X\n", ret & 0xF);
- cs4270 = kzalloc(sizeof(struct cs4270_private), GFP_KERNEL);
+ cs4270 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs4270_private),
+ GFP_KERNEL);
if (!cs4270) {
dev_err(&i2c_client->dev, "could not allocate codec\n");
return -ENOMEM;
@@ -682,8 +683,6 @@ static int cs4270_i2c_probe(struct i2c_client *i2c_client,
ret = snd_soc_register_codec(&i2c_client->dev,
&soc_codec_device_cs4270, &cs4270_dai, 1);
- if (ret < 0)
- kfree(cs4270);
return ret;
}
@@ -696,7 +695,6 @@ static int cs4270_i2c_probe(struct i2c_client *i2c_client,
static int cs4270_i2c_remove(struct i2c_client *i2c_client)
{
snd_soc_unregister_codec(&i2c_client->dev);
- kfree(i2c_get_clientdata(i2c_client));
return 0;
}