aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/soc-io.c')
-rw-r--r--sound/soc/soc-io.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c
index 44d0174b4d97..29183ef2b93d 100644
--- a/sound/soc/soc-io.c
+++ b/sound/soc/soc-io.c
@@ -145,10 +145,13 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
145 if (!codec->control_data) 145 if (!codec->control_data)
146 codec->control_data = dev_get_regmap(codec->dev, NULL); 146 codec->control_data = dev_get_regmap(codec->dev, NULL);
147 147
148 ret = regmap_get_val_bytes(codec->control_data); 148 if (codec->control_data) {
149 /* Errors are legitimate for non-integer byte multiples */ 149 ret = regmap_get_val_bytes(codec->control_data);
150 if (ret > 0) 150 /* Errors are legitimate for non-integer byte
151 codec->val_bytes = ret; 151 * multiples */
152 if (ret > 0)
153 codec->val_bytes = ret;
154 }
152 break; 155 break;
153 156
154 default: 157 default: