From 06dcddd3f9587361e1dcb5191ca34087fce4645c Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 20 Dec 2011 14:39:20 +0800 Subject: [PATCH] --- yaml --- r: 283989 b: refs/heads/master c: 4273fcfd71285b4ab6a5d3ce3943e30c2975b797 h: refs/heads/master i: 283987: f74d7643fead6026c968518b4e260a73f1680e68 v: v3 --- [refs] | 2 +- trunk/sound/soc/codecs/ak4641.c | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index d6f2535e8ffe..1db359aac4d4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7246492dcf0e56d23f71194f8cd8722a681dfa47 +refs/heads/master: 4273fcfd71285b4ab6a5d3ce3943e30c2975b797 diff --git a/trunk/sound/soc/codecs/ak4641.c b/trunk/sound/soc/codecs/ak4641.c index 90184701480d..266ebea2b65a 100644 --- a/trunk/sound/soc/codecs/ak4641.c +++ b/trunk/sound/soc/codecs/ak4641.c @@ -602,7 +602,8 @@ static int __devinit ak4641_i2c_probe(struct i2c_client *i2c, struct ak4641_priv *ak4641; int ret; - ak4641 = kzalloc(sizeof(struct ak4641_priv), GFP_KERNEL); + ak4641 = devm_kzalloc(&i2c->dev, sizeof(struct ak4641_priv), + GFP_KERNEL); if (!ak4641) return -ENOMEM; @@ -610,16 +611,12 @@ static int __devinit ak4641_i2c_probe(struct i2c_client *i2c, ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_ak4641, ak4641_dai, ARRAY_SIZE(ak4641_dai)); - if (ret < 0) - kfree(ak4641); - return ret; } static int __devexit ak4641_i2c_remove(struct i2c_client *i2c) { snd_soc_unregister_codec(&i2c->dev); - kfree(i2c_get_clientdata(i2c)); return 0; }