From cc028c4e80bcbad0b9f2c616fdca57cdad1c8cd9 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 26 Dec 2011 20:51:16 +0800 Subject: [PATCH] --- yaml --- r: 284031 b: refs/heads/master c: 30c88f2ca89d6c0706ab585beca3730c9d7524de h: refs/heads/master i: 284029: faae472281547cf9148b76dd47860ce773a9756e 284027: c3c3c5c90b49c5ecb83e9efb5d3066df30f3ffe3 284023: 0a19a89fd9ec28434bed1e6b24d56e9b40720323 284015: 435b744dd9370eda54f94f6596c3d8f7d1c450c7 283999: 1265008120c9d833909e6e4389e0de9fe852e4ea 283967: d8ff424a27e0f01221e9ed68a34aa287e5dd4f54 283903: e1e6aed5217363ca8293a701ab2e17d746482d19 v: v3 --- [refs] | 2 +- trunk/sound/soc/codecs/ad193x.c | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/[refs] b/[refs] index 1c7055b11e7c..4b3bac7ae1ba 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a5b683489fd3c83f3951eccdc6aee14f50474dda +refs/heads/master: 30c88f2ca89d6c0706ab585beca3730c9d7524de diff --git a/trunk/sound/soc/codecs/ad193x.c b/trunk/sound/soc/codecs/ad193x.c index c1b7d928c347..a4a6bef2c0bb 100644 --- a/trunk/sound/soc/codecs/ad193x.c +++ b/trunk/sound/soc/codecs/ad193x.c @@ -385,14 +385,15 @@ static int __devinit ad193x_spi_probe(struct spi_device *spi) struct ad193x_priv *ad193x; int ret; - ad193x = kzalloc(sizeof(struct ad193x_priv), GFP_KERNEL); + ad193x = devm_kzalloc(&spi->dev, sizeof(struct ad193x_priv), + GFP_KERNEL); if (ad193x == NULL) return -ENOMEM; ad193x->regmap = regmap_init_spi(spi, &ad193x_spi_regmap_config); if (IS_ERR(ad193x->regmap)) { ret = PTR_ERR(ad193x->regmap); - goto err_free; + goto err_out; } spi_set_drvdata(spi, ad193x); @@ -406,9 +407,7 @@ static int __devinit ad193x_spi_probe(struct spi_device *spi) err_regmap_exit: regmap_exit(ad193x->regmap); -err_free: - kfree(ad193x); - +err_out: return ret; } @@ -418,7 +417,6 @@ static int __devexit ad193x_spi_remove(struct spi_device *spi) snd_soc_unregister_codec(&spi->dev); regmap_exit(ad193x->regmap); - kfree(ad193x); return 0; } @@ -455,14 +453,15 @@ static int __devinit ad193x_i2c_probe(struct i2c_client *client, struct ad193x_priv *ad193x; int ret; - ad193x = kzalloc(sizeof(struct ad193x_priv), GFP_KERNEL); + ad193x = devm_kzalloc(&client->dev, sizeof(struct ad193x_priv), + GFP_KERNEL); if (ad193x == NULL) return -ENOMEM; ad193x->regmap = regmap_init_i2c(client, &ad193x_i2c_regmap_config); if (IS_ERR(ad193x->regmap)) { ret = PTR_ERR(ad193x->regmap); - goto err_free; + goto err_out; } i2c_set_clientdata(client, ad193x); @@ -476,8 +475,7 @@ static int __devinit ad193x_i2c_probe(struct i2c_client *client, err_regmap_exit: regmap_exit(ad193x->regmap); -err_free: - kfree(ad193x); +err_out: return ret; } @@ -487,7 +485,6 @@ static int __devexit ad193x_i2c_remove(struct i2c_client *client) snd_soc_unregister_codec(&client->dev); regmap_exit(ad193x->regmap); - kfree(ad193x); return 0; }