diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-08-31 14:31:13 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-16 19:37:03 -0400 |
commit | b012aa619e50d22df0835b64a5dcebc221fb8053 (patch) | |
tree | 865f9b33347b38012c95af67df3bb58b4d9be604 /sound/soc/soc-core.c | |
parent | 2a1212a8342c469cee240cf69fe3001b898cda8e (diff) |
ASoC: Remove reg_def_copy
reg_def_copy was introduced in commit 3335ddca ("ASoC: soc-cache: Use
reg_def_copy instead of reg_cache_default") to keep a copy of the register
defaults around in case the register defaults where placed in the __devinitdata
section. With the __devinitdata section gone we effectivly keep the same data
around twice. This patch removes reg_def_copy and uses reg_cache_default
directly instead.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 4ce02e6777e5..bbe833ab657e 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -4201,20 +4201,6 @@ int snd_soc_register_codec(struct device *dev, | |||
4201 | if (codec_drv->reg_cache_size && codec_drv->reg_word_size) { | 4201 | if (codec_drv->reg_cache_size && codec_drv->reg_word_size) { |
4202 | reg_size = codec_drv->reg_cache_size * codec_drv->reg_word_size; | 4202 | reg_size = codec_drv->reg_cache_size * codec_drv->reg_word_size; |
4203 | codec->reg_size = reg_size; | 4203 | codec->reg_size = reg_size; |
4204 | /* it is necessary to make a copy of the default register cache | ||
4205 | * because in the case of using a compression type that requires | ||
4206 | * the default register cache to be marked as the | ||
4207 | * kernel might have freed the array by the time we initialize | ||
4208 | * the cache. | ||
4209 | */ | ||
4210 | if (codec_drv->reg_cache_default) { | ||
4211 | codec->reg_def_copy = kmemdup(codec_drv->reg_cache_default, | ||
4212 | reg_size, GFP_KERNEL); | ||
4213 | if (!codec->reg_def_copy) { | ||
4214 | ret = -ENOMEM; | ||
4215 | goto fail_codec_name; | ||
4216 | } | ||
4217 | } | ||
4218 | } | 4204 | } |
4219 | 4205 | ||
4220 | for (i = 0; i < num_dai; i++) { | 4206 | for (i = 0; i < num_dai; i++) { |
@@ -4273,7 +4259,6 @@ found: | |||
4273 | dev_dbg(codec->dev, "ASoC: Unregistered codec '%s'\n", codec->name); | 4259 | dev_dbg(codec->dev, "ASoC: Unregistered codec '%s'\n", codec->name); |
4274 | 4260 | ||
4275 | snd_soc_cache_exit(codec); | 4261 | snd_soc_cache_exit(codec); |
4276 | kfree(codec->reg_def_copy); | ||
4277 | kfree(codec->name); | 4262 | kfree(codec->name); |
4278 | kfree(codec); | 4263 | kfree(codec); |
4279 | } | 4264 | } |