diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-12-28 22:56:23 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-01-02 07:28:13 -0500 |
commit | 360b70ca5e4668c9b9e24d8b200e7069bec83b4e (patch) | |
tree | 20881bdb561eac7e7bce80adb6927b13b7d759ee /sound/soc | |
parent | e2257db325e8031a149c0f8e3f228d02d08ae578 (diff) |
ASoC: Convert alc5623 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/codecs/alc5623.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sound/soc/codecs/alc5623.c b/sound/soc/codecs/alc5623.c index 6a9b621ef32d..3feee569ceea 100644 --- a/sound/soc/codecs/alc5623.c +++ b/sound/soc/codecs/alc5623.c | |||
@@ -1022,7 +1022,8 @@ static int alc5623_i2c_probe(struct i2c_client *client, | |||
1022 | 1022 | ||
1023 | dev_dbg(&client->dev, "Found codec id : alc56%02x\n", vid2); | 1023 | dev_dbg(&client->dev, "Found codec id : alc56%02x\n", vid2); |
1024 | 1024 | ||
1025 | alc5623 = kzalloc(sizeof(struct alc5623_priv), GFP_KERNEL); | 1025 | alc5623 = devm_kzalloc(&client->dev, sizeof(struct alc5623_priv), |
1026 | GFP_KERNEL); | ||
1026 | if (alc5623 == NULL) | 1027 | if (alc5623 == NULL) |
1027 | return -ENOMEM; | 1028 | return -ENOMEM; |
1028 | 1029 | ||
@@ -1044,7 +1045,6 @@ static int alc5623_i2c_probe(struct i2c_client *client, | |||
1044 | alc5623_dai.name = "alc5623-hifi"; | 1045 | alc5623_dai.name = "alc5623-hifi"; |
1045 | break; | 1046 | break; |
1046 | default: | 1047 | default: |
1047 | kfree(alc5623); | ||
1048 | return -EINVAL; | 1048 | return -EINVAL; |
1049 | } | 1049 | } |
1050 | 1050 | ||
@@ -1053,20 +1053,15 @@ static int alc5623_i2c_probe(struct i2c_client *client, | |||
1053 | 1053 | ||
1054 | ret = snd_soc_register_codec(&client->dev, | 1054 | ret = snd_soc_register_codec(&client->dev, |
1055 | &soc_codec_device_alc5623, &alc5623_dai, 1); | 1055 | &soc_codec_device_alc5623, &alc5623_dai, 1); |
1056 | if (ret != 0) { | 1056 | if (ret != 0) |
1057 | dev_err(&client->dev, "Failed to register codec: %d\n", ret); | 1057 | dev_err(&client->dev, "Failed to register codec: %d\n", ret); |
1058 | kfree(alc5623); | ||
1059 | } | ||
1060 | 1058 | ||
1061 | return ret; | 1059 | return ret; |
1062 | } | 1060 | } |
1063 | 1061 | ||
1064 | static int alc5623_i2c_remove(struct i2c_client *client) | 1062 | static int alc5623_i2c_remove(struct i2c_client *client) |
1065 | { | 1063 | { |
1066 | struct alc5623_priv *alc5623 = i2c_get_clientdata(client); | ||
1067 | |||
1068 | snd_soc_unregister_codec(&client->dev); | 1064 | snd_soc_unregister_codec(&client->dev); |
1069 | kfree(alc5623); | ||
1070 | return 0; | 1065 | return 0; |
1071 | } | 1066 | } |
1072 | 1067 | ||