From 38b81c1d2517d7c4a6685d49136474bcd0105ab9 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 26 Dec 2011 20:53:09 +0800 Subject: [PATCH] ASoC: Convert adau1701 to devm_kzalloc() Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- sound/soc/codecs/adau1701.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c index 6a6af567f02a..6b325ea03869 100644 --- a/sound/soc/codecs/adau1701.c +++ b/sound/soc/codecs/adau1701.c @@ -496,23 +496,19 @@ static __devinit int adau1701_i2c_probe(struct i2c_client *client, struct adau1701 *adau1701; int ret; - adau1701 = kzalloc(sizeof(*adau1701), GFP_KERNEL); + adau1701 = devm_kzalloc(&client->dev, sizeof(*adau1701), GFP_KERNEL); if (!adau1701) return -ENOMEM; i2c_set_clientdata(client, adau1701); ret = snd_soc_register_codec(&client->dev, &adau1701_codec_drv, &adau1701_dai, 1); - if (ret < 0) - kfree(adau1701); - return ret; } static __devexit int adau1701_i2c_remove(struct i2c_client *client) { snd_soc_unregister_codec(&client->dev); - kfree(i2c_get_clientdata(client)); return 0; } -- 2.30.2