ASoC: Convert sgtl500 to use devm_kzalloc()
Subsystems (3)
Fabio Estevam
maintainerPATCH 1/1 ASoC: Convert sgtl500 to use devm_kzalloc()
Convert sgtl500 codec driver to use devm_kzalloc().
Signed-off-by Fabio Estevam <[email protected]>
--- sound/soc/codecs/sgtl5000.c | 14 +++----------- 1 files changed, 3 insertions(+), 11 deletions(-)
sound/soc/codecs/sgtl5000.c +3 -11
@@ -1402,7 +1402,8 @@ static __devinit int sgtl5000_i2c_probe(struct i2c_client *client,struct sgtl5000_priv *sgtl5000;int ret; - sgtl5000 =kzalloc (sizeof (struct sgtl5000_priv ),GFP_KERNEL ); + sgtl5000 =devm_kzalloc (&client->dev,sizeof (struct sgtl5000_priv ), +GFP_KERNEL );if (!sgtl5000)return -ENOMEM ;
@@ -1410,22 +1411,13 @@ static __devinit int sgtl5000_i2c_probe(struct i2c_client *client, ret =snd_soc_register_codec (&client->dev, &sgtl5000_driver, &sgtl5000_dai,1 ); -if (ret) { -dev_err (&client->dev,"Failed to register codec: %d\n" , ret); -kfree (sgtl5000); -return ret; - } - -return 0 ; +return ret; } static __devexit int sgtl5000_i2c_remove(struct i2c_client *client) { -struct sgtl5000_priv *sgtl5000 =i2c_get_clientdata (client); -snd_soc_unregister_codec (&client->dev); -kfree (sgtl5000);return 0 ; }
Signature · 1 line
1.7.1
Fabio Estevam
maintainerPATCH 1/1 ASoC: Convert sgtl5000 to use devm_kzalloc()
Convert sgtl5000 codec driver to use devm_kzalloc().
Signed-off-by Fabio Estevam <[email protected]>
---
Changes since v1:
- Fixed typo in codec name
sound/soc/codecs/sgtl5000.c | 14 +++----------- 1 files changed, 3 insertions(+), 11 deletions(-)
sound/soc/codecs/sgtl5000.c +3 -11
@@ -1402,7 +1402,8 @@ static __devinit int sgtl5000_i2c_probe(struct i2c_client *client,struct sgtl5000_priv *sgtl5000;int ret; - sgtl5000 =kzalloc (sizeof (struct sgtl5000_priv ),GFP_KERNEL ); + sgtl5000 =devm_kzalloc (&client->dev,sizeof (struct sgtl5000_priv ), +GFP_KERNEL );if (!sgtl5000)return -ENOMEM ;
@@ -1410,22 +1411,13 @@ static __devinit int sgtl5000_i2c_probe(struct i2c_client *client, ret =snd_soc_register_codec (&client->dev, &sgtl5000_driver, &sgtl5000_dai,1 ); -if (ret) { -dev_err (&client->dev,"Failed to register codec: %d\n" , ret); -kfree (sgtl5000); -return ret; - } - -return 0 ; +return ret; } static __devexit int sgtl5000_i2c_remove(struct i2c_client *client) { -struct sgtl5000_priv *sgtl5000 =i2c_get_clientdata (client); -snd_soc_unregister_codec (&client->dev); -kfree (sgtl5000);return 0 ; }
Signature · 1 line
1.7.1
Mark Brown
AppliedRe: [PATCH] ASoC: Convert sgtl5000 to use devm_kzalloc()
Quoted 1 line · Fabio Estevam
Convert sgtl5000 codec driver to use
devm_kzalloc().
Applied, thanks.