diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-10 03:14:16 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-10 04:00:02 -0400 |
commit | d6e2dc150ba748c4de518532b0d71275e3c3d959 (patch) | |
tree | c8564f3a2404489fd20b3b52ddd7f2885a5c775d /sound/soc/codecs/wm8983.c | |
parent | 822b4b8d63e09076a4487eb881d3b7a13b28121c (diff) |
ASoC: wm8983: Convert to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8983.c')
-rw-r--r-- | sound/soc/codecs/wm8983.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sound/soc/codecs/wm8983.c b/sound/soc/codecs/wm8983.c index 367388fdc48..57c33fc1968 100644 --- a/sound/soc/codecs/wm8983.c +++ b/sound/soc/codecs/wm8983.c | |||
@@ -1085,7 +1085,7 @@ static int __devinit wm8983_spi_probe(struct spi_device *spi) | |||
1085 | struct wm8983_priv *wm8983; | 1085 | struct wm8983_priv *wm8983; |
1086 | int ret; | 1086 | int ret; |
1087 | 1087 | ||
1088 | wm8983 = kzalloc(sizeof *wm8983, GFP_KERNEL); | 1088 | wm8983 = devm_kzalloc(&spi->dev, sizeof *wm8983, GFP_KERNEL); |
1089 | if (!wm8983) | 1089 | if (!wm8983) |
1090 | return -ENOMEM; | 1090 | return -ENOMEM; |
1091 | 1091 | ||
@@ -1094,15 +1094,12 @@ static int __devinit wm8983_spi_probe(struct spi_device *spi) | |||
1094 | 1094 | ||
1095 | ret = snd_soc_register_codec(&spi->dev, | 1095 | ret = snd_soc_register_codec(&spi->dev, |
1096 | &soc_codec_dev_wm8983, &wm8983_dai, 1); | 1096 | &soc_codec_dev_wm8983, &wm8983_dai, 1); |
1097 | if (ret < 0) | ||
1098 | kfree(wm8983); | ||
1099 | return ret; | 1097 | return ret; |
1100 | } | 1098 | } |
1101 | 1099 | ||
1102 | static int __devexit wm8983_spi_remove(struct spi_device *spi) | 1100 | static int __devexit wm8983_spi_remove(struct spi_device *spi) |
1103 | { | 1101 | { |
1104 | snd_soc_unregister_codec(&spi->dev); | 1102 | snd_soc_unregister_codec(&spi->dev); |
1105 | kfree(spi_get_drvdata(spi)); | ||
1106 | return 0; | 1103 | return 0; |
1107 | } | 1104 | } |
1108 | 1105 | ||
@@ -1123,7 +1120,7 @@ static __devinit int wm8983_i2c_probe(struct i2c_client *i2c, | |||
1123 | struct wm8983_priv *wm8983; | 1120 | struct wm8983_priv *wm8983; |
1124 | int ret; | 1121 | int ret; |
1125 | 1122 | ||
1126 | wm8983 = kzalloc(sizeof *wm8983, GFP_KERNEL); | 1123 | wm8983 = devm_kzalloc(&i2c->dev, sizeof *wm8983, GFP_KERNEL); |
1127 | if (!wm8983) | 1124 | if (!wm8983) |
1128 | return -ENOMEM; | 1125 | return -ENOMEM; |
1129 | 1126 | ||
@@ -1132,15 +1129,13 @@ static __devinit int wm8983_i2c_probe(struct i2c_client *i2c, | |||
1132 | 1129 | ||
1133 | ret = snd_soc_register_codec(&i2c->dev, | 1130 | ret = snd_soc_register_codec(&i2c->dev, |
1134 | &soc_codec_dev_wm8983, &wm8983_dai, 1); | 1131 | &soc_codec_dev_wm8983, &wm8983_dai, 1); |
1135 | if (ret < 0) | 1132 | |
1136 | kfree(wm8983); | ||
1137 | return ret; | 1133 | return ret; |
1138 | } | 1134 | } |
1139 | 1135 | ||
1140 | static __devexit int wm8983_i2c_remove(struct i2c_client *client) | 1136 | static __devexit int wm8983_i2c_remove(struct i2c_client *client) |
1141 | { | 1137 | { |
1142 | snd_soc_unregister_codec(&client->dev); | 1138 | snd_soc_unregister_codec(&client->dev); |
1143 | kfree(i2c_get_clientdata(client)); | ||
1144 | return 0; | 1139 | return 0; |
1145 | } | 1140 | } |
1146 | 1141 | ||