diff options
Diffstat (limited to 'sound/soc/soc-io.c')
-rw-r--r-- | sound/soc/soc-io.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c index 4d8dc6a27d4d..29183ef2b93d 100644 --- a/sound/soc/soc-io.c +++ b/sound/soc/soc-io.c | |||
@@ -142,11 +142,16 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, | |||
142 | case SND_SOC_REGMAP: | 142 | case SND_SOC_REGMAP: |
143 | /* Device has made its own regmap arrangements */ | 143 | /* Device has made its own regmap arrangements */ |
144 | codec->using_regmap = true; | 144 | codec->using_regmap = true; |
145 | 145 | if (!codec->control_data) | |
146 | ret = regmap_get_val_bytes(codec->control_data); | 146 | codec->control_data = dev_get_regmap(codec->dev, NULL); |
147 | /* Errors are legitimate for non-integer byte multiples */ | 147 | |
148 | if (ret > 0) | 148 | if (codec->control_data) { |
149 | codec->val_bytes = ret; | 149 | ret = regmap_get_val_bytes(codec->control_data); |
150 | /* Errors are legitimate for non-integer byte | ||
151 | * multiples */ | ||
152 | if (ret > 0) | ||
153 | codec->val_bytes = ret; | ||
154 | } | ||
150 | break; | 155 | break; |
151 | 156 | ||
152 | default: | 157 | default: |