Commit 2aa86323 authored by Dimitris Papastamos's avatar Dimitris Papastamos Committed by Mark Brown

ASoC: soc-core: Add support for NULL default register caches

The infrastructure for handling NULL default register maps is already
included in the soc-cache code, just ensure that we don't try to dereference
a NULL pointer while accessing a NULL register cache.
Signed-off-by: default avatarDimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: default avatarTimur Tabi <timur@freescale.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 0d51a9cb
...@@ -3507,6 +3507,7 @@ int snd_soc_register_codec(struct device *dev, ...@@ -3507,6 +3507,7 @@ int snd_soc_register_codec(struct device *dev,
* kernel might have freed the array by the time we initialize * kernel might have freed the array by the time we initialize
* the cache. * the cache.
*/ */
if (codec_drv->reg_cache_default) {
codec->reg_def_copy = kmemdup(codec_drv->reg_cache_default, codec->reg_def_copy = kmemdup(codec_drv->reg_cache_default,
reg_size, GFP_KERNEL); reg_size, GFP_KERNEL);
if (!codec->reg_def_copy) { if (!codec->reg_def_copy) {
...@@ -3514,6 +3515,7 @@ int snd_soc_register_codec(struct device *dev, ...@@ -3514,6 +3515,7 @@ int snd_soc_register_codec(struct device *dev,
goto fail; goto fail;
} }
} }
}
for (i = 0; i < num_dai; i++) { for (i = 0; i < num_dai; i++) {
fixup_codec_formats(&dai_drv[i].playback); fixup_codec_formats(&dai_drv[i].playback);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment