ASoC: Convert 88pm860x-codec to devm_kzalloc()
Subsystems (6)
PATCH 1/10 ASoC: Convert 88pm860x-codec to devm_kzalloc()
--- sound/soc/codecs/88pm860x-codec.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)
sound/soc/codecs/88pm860x-codec.c +2 -5
@@ -1430,7 +1430,8 @@ static int __devinit pm860x_codec_probe(struct platform_device *pdev)struct resource *res;int i, ret; - pm860x =kzalloc (sizeof (struct pm860x_priv ),GFP_KERNEL ); + pm860x =devm_kzalloc (&pdev->dev,sizeof (struct pm860x_priv ), +GFP_KERNEL );if (pm860x ==NULL )return -ENOMEM ;
@@ -1459,17 +1460,13 @@ static int __devinit pm860x_codec_probe(struct platform_device *pdev) out:platform_set_drvdata (pdev,NULL ); -kfree (pm860x);return -EINVAL ; } static int __devexit pm860x_codec_remove(struct platform_device *pdev) { -struct pm860x_priv *pm860x =platform_get_drvdata (pdev); -snd_soc_unregister_codec (&pdev->dev);platform_set_drvdata (pdev,NULL ); -kfree (pm860x);return 0 ; }
Signature · 1 line
1.7.5.4
PATCH 2/10 ASoC: Convert ad1836 to devm_kzalloc()
--- sound/soc/codecs/ad1836.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
sound/soc/codecs/ad1836.c +3 -4
@@ -341,7 +341,8 @@ static int __devinit ad1836_spi_probe(struct spi_device *spi)struct ad1836_priv *ad1836;int ret; - ad1836 =kzalloc (sizeof (struct ad1836_priv ),GFP_KERNEL ); + ad1836 =devm_kzalloc (&spi->dev,sizeof (struct ad1836_priv ), +GFP_KERNEL );if (ad1836 ==NULL )return -ENOMEM ;
@@ -351,17 +352,15 @@ static int __devinit ad1836_spi_probe(struct spi_device *spi) ret =snd_soc_register_codec (&spi->dev, &soc_codec_dev_ad1836, &ad183x_dais[ad1836->type],1 ); -if (ret <0 ) -kfree (ad1836);return ret; } static int __devexit ad1836_spi_remove(struct spi_device *spi) {snd_soc_unregister_codec (&spi->dev); -kfree (spi_get_drvdata (spi));return 0 ; } +static const struct spi_device_id ad1836_ids[] = { {"ad1835" ,AD1835 }, {"ad1836" ,AD1836 },
Signature · 1 line
1.7.5.4
Re: [PATCH 02/10] ASoC: Convert ad1836 to devm_kzalloc()
Quoted 1 line · Axel Lin
Signed-off-by Axel Lin <[email protected]>
Applied the rest of these, thanks.
PATCH 3/10 ASoC: Convert ad193x to devm_kzalloc()
In reply to Axel Lin--- sound/soc/codecs/ad193x.c | 19 ++++++++----------- 1 files changed, 8 insertions(+), 11 deletions(-)
sound/soc/codecs/ad193x.c +8 -11
@@ -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 ; }
Signature · 1 line
1.7.5.4
PATCH 4/10 ASoC: Convert adau1373 to devm_kzalloc()
In reply to Axel Lin--- sound/soc/codecs/adau1373.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)
sound/soc/codecs/adau1373.c +1 -5
@@ -1360,7 +1360,7 @@ static int __devinit adau1373_i2c_probe(struct i2c_client *client,struct adau1373 *adau1373;int ret; - adau1373 =kzalloc (sizeof (*adau1373),GFP_KERNEL ); + adau1373 =devm_kzalloc (&client->dev,sizeof (*adau1373),GFP_KERNEL );if (!adau1373)return -ENOMEM ;
@@ -1368,16 +1368,12 @@ static int __devinit adau1373_i2c_probe(struct i2c_client *client, ret =snd_soc_register_codec (&client->dev, &adau1373_codec_driver, adau1373_dai_driver,ARRAY_SIZE (adau1373_dai_driver)); -if (ret <0 ) -kfree (adau1373); -return ret; } static int __devexit adau1373_i2c_remove(struct i2c_client *client) {snd_soc_unregister_codec (&client->dev); -kfree (dev_get_drvdata (&client->dev));return 0 ; }
Signature · 1 line
1.7.5.4
PATCH 5/10 ASoC: Convert adau1701 to devm_kzalloc()
In reply to Axel Lin--- sound/soc/codecs/adau1701.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)
sound/soc/codecs/adau1701.c +1 -5
@@ -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 ; }
Signature · 1 line
1.7.5.4
PATCH 6/10 ASoC: Convert da7210 to devm_kzalloc()
In reply to Axel Lin--- sound/soc/codecs/da7210.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)
sound/soc/codecs/da7210.c +2 -5
@@ -944,7 +944,8 @@ static int __devinit da7210_i2c_probe(struct i2c_client *i2c,struct da7210_priv *da7210;int ret; - da7210 =kzalloc (sizeof (struct da7210_priv ),GFP_KERNEL ); + da7210 =devm_kzalloc (&i2c->dev,sizeof (struct da7210_priv ), +GFP_KERNEL );if (!da7210)return -ENOMEM ;
@@ -953,16 +954,12 @@ static int __devinit da7210_i2c_probe(struct i2c_client *i2c, ret =snd_soc_register_codec (&i2c->dev, &soc_codec_dev_da7210, &da7210_dai,1 ); -if (ret <0 ) -kfree (da7210); -return ret; } static int __devexit da7210_i2c_remove(struct i2c_client *client) {snd_soc_unregister_codec (&client->dev); -kfree (i2c_get_clientdata (client));return 0 ; }
Signature · 1 line
1.7.5.4
Mark Brown
AppliedRe: [PATCH 06/10] ASoC: Convert da7210 to devm_kzalloc()
Quoted 1 line · Axel Lin
Signed-off-by Axel Lin <[email protected]>
Applied, thanks.
PATCH 7/10 ASoC: Convert jz4740 to devm_kzalloc()
In reply to Axel Lin--- sound/soc/codecs/jz4740.c | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-)
sound/soc/codecs/jz4740.c +5 -7
@@ -353,7 +353,8 @@ static int __devinit jz4740_codec_probe(struct platform_device *pdev)struct jz4740_codec *jz4740_codec;struct resource *mem; - jz4740_codec =kzalloc (sizeof (*jz4740_codec),GFP_KERNEL ); + jz4740_codec =devm_kzalloc (&pdev->dev,sizeof (*jz4740_codec), +GFP_KERNEL );if (!jz4740_codec)return -ENOMEM ;
@@ -361,14 +362,14 @@ static int __devinit jz4740_codec_probe(struct platform_device *pdev)if (!mem) {dev_err (&pdev->dev,"Failed to get mmio memory resource\n" ); ret = -ENOENT ; - goto err_free_codec; + goto err_out; } mem =request_mem_region (mem->start,resource_size (mem), pdev->name);if (!mem) {dev_err (&pdev->dev,"Failed to request mmio memory region\n" ); ret = -EBUSY ; - goto err_free_codec; + goto err_out; } jz4740_codec->base =ioremap (mem->start,resource_size (mem));
@@ -394,9 +395,7 @@ err_iounmap:iounmap (jz4740_codec->base); err_release_mem_region:release_mem_region (mem->start,resource_size (mem)); -err_free_codec: -kfree (jz4740_codec); - +err_out:return ret; }
@@ -411,7 +410,6 @@ static int __devexit jz4740_codec_remove(struct platform_device *pdev)release_mem_region (mem->start,resource_size (mem));platform_set_drvdata (pdev,NULL ); -kfree (jz4740_codec);return 0 ; }
Signature · 1 line
1.7.5.4
PATCH 8/10 ASoC: Convert lm4857 to devm_kzalloc()
In reply to Axel Lin--- sound/soc/codecs/lm4857.c | 13 ++----------- 1 files changed, 2 insertions(+), 11 deletions(-)
sound/soc/codecs/lm4857.c +2 -11
@@ -215,7 +215,7 @@ static int __devinit lm4857_i2c_probe(struct i2c_client *i2c,struct lm4857 *lm4857;int ret; - lm4857 =kzalloc (sizeof (*lm4857),GFP_KERNEL ); + lm4857 =devm_kzalloc (&i2c->dev,sizeof (*lm4857),GFP_KERNEL );if (!lm4857)return -ENOMEM ;
@@ -225,21 +225,12 @@ static int __devinit lm4857_i2c_probe(struct i2c_client *i2c, ret =snd_soc_register_codec (&i2c->dev, &soc_codec_dev_lm4857,NULL ,0 ); -if (ret) { -kfree (lm4857); -return ret; - } - -return 0 ; +return ret; } static int __devexit lm4857_i2c_remove(struct i2c_client *i2c) { -struct lm4857 *lm4857 =i2c_get_clientdata (i2c); -snd_soc_unregister_codec (&i2c->dev); -kfree (lm4857); -return 0 ; }
Signature · 1 line
1.7.5.4
Mark Brown
AppliedRe: [PATCH 08/10] ASoC: Convert lm4857 to devm_kzalloc()
Quoted 1 line · Axel Lin
Signed-off-by Axel Lin <[email protected]>
Applied, thanks.
PATCH 9/10 ASoC: Convert tlv320aic32x4 to devm_kzalloc()
In reply to Axel Lin--- sound/soc/codecs/tlv320aic32x4.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
sound/soc/codecs/tlv320aic32x4.c +2 -4
@@ -709,7 +709,8 @@ static __devinit int aic32x4_i2c_probe(struct i2c_client *i2c,struct aic32x4_priv *aic32x4;int ret; - aic32x4 =kzalloc (sizeof (struct aic32x4_priv ),GFP_KERNEL ); + aic32x4 =devm_kzalloc (&i2c->dev,sizeof (struct aic32x4_priv ), +GFP_KERNEL );if (aic32x4 ==NULL )return -ENOMEM ;
@@ -728,15 +729,12 @@ static __devinit int aic32x4_i2c_probe(struct i2c_client *i2c, ret =snd_soc_register_codec (&i2c->dev, &soc_codec_dev_aic32x4, &aic32x4_dai,1 ); -if (ret <0 ) -kfree (aic32x4);return ret; } static __devexit int aic32x4_i2c_remove(struct i2c_client *client) {snd_soc_unregister_codec (&client->dev); -kfree (i2c_get_clientdata (client));return 0 ; }
Signature · 1 line
1.7.5.4
PATCH 10/10 ASoC: Convert uda1380 to devm_kzalloc()
In reply to Axel Lin--- sound/soc/codecs/uda1380.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
sound/soc/codecs/uda1380.c +2 -4
@@ -803,7 +803,8 @@ static __devinit int uda1380_i2c_probe(struct i2c_client *i2c,struct uda1380_priv *uda1380;int ret; - uda1380 =kzalloc (sizeof (struct uda1380_priv ),GFP_KERNEL ); + uda1380 =devm_kzalloc (&i2c->dev,sizeof (struct uda1380_priv ), +GFP_KERNEL );if (uda1380 ==NULL )return -ENOMEM ;
@@ -812,15 +813,12 @@ static __devinit int uda1380_i2c_probe(struct i2c_client *i2c, ret =snd_soc_register_codec (&i2c->dev, &soc_codec_dev_uda1380, uda1380_dai,ARRAY_SIZE (uda1380_dai)); -if (ret <0 ) -kfree (uda1380);return ret; } static int __devexit uda1380_i2c_remove(struct i2c_client *i2c) {snd_soc_unregister_codec (&i2c->dev); -kfree (i2c_get_clientdata (i2c));return 0 ; }
Signature · 1 line
1.7.5.4
Mark Brown
AppliedRe: [PATCH 10/10] ASoC: Convert uda1380 to devm_kzalloc()
Quoted 1 line · Axel Lin
Signed-off-by Axel Lin <[email protected]>
Applied, thanks.
Mark Brown
AppliedQuoted 1 line · Axel Lin
Signed-off-by Axel Lin <[email protected]>
Applied, thanks.