From d2256d2595248d1f8cb33b8d265d63eb6afff65a Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 29 Dec 2011 12:06:39 +0800 Subject: [PATCH] --- yaml --- r: 284051 b: refs/heads/master c: d999c021b64289b571e5d295deade44e40cbcc4f h: refs/heads/master i: 284049: c58b7fe12abe2bc02cf4c16ddf010e222b1a851d 284047: 497a2e3111f993f7a8995c04024f039006fa39f6 v: v3 --- [refs] | 2 +- trunk/sound/soc/codecs/sta32x.c | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 333992fc13b5..b23949cf3718 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8eeffe9891dbb74aedcb9a82da4733961d7b432f +refs/heads/master: d999c021b64289b571e5d295deade44e40cbcc4f diff --git a/trunk/sound/soc/codecs/sta32x.c b/trunk/sound/soc/codecs/sta32x.c index 6648af6656c8..fbd145091356 100644 --- a/trunk/sound/soc/codecs/sta32x.c +++ b/trunk/sound/soc/codecs/sta32x.c @@ -968,28 +968,23 @@ static __devinit int sta32x_i2c_probe(struct i2c_client *i2c, struct sta32x_priv *sta32x; int ret; - sta32x = kzalloc(sizeof(struct sta32x_priv), GFP_KERNEL); + sta32x = devm_kzalloc(&i2c->dev, sizeof(struct sta32x_priv), + GFP_KERNEL); if (!sta32x) return -ENOMEM; i2c_set_clientdata(i2c, sta32x); ret = snd_soc_register_codec(&i2c->dev, &sta32x_codec, &sta32x_dai, 1); - if (ret != 0) { + if (ret != 0) dev_err(&i2c->dev, "Failed to register codec (%d)\n", ret); - kfree(sta32x); - return ret; - } - return 0; + return ret; } static __devexit int sta32x_i2c_remove(struct i2c_client *client) { - struct sta32x_priv *sta32x = i2c_get_clientdata(client); - snd_soc_unregister_codec(&client->dev); - kfree(sta32x); return 0; }