aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/soc-core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 4dda58926bc5..b76b74db0968 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -92,8 +92,8 @@ static int min_bytes_needed(unsigned long val)
92static int format_register_str(struct snd_soc_codec *codec, 92static int format_register_str(struct snd_soc_codec *codec,
93 unsigned int reg, char *buf, size_t len) 93 unsigned int reg, char *buf, size_t len)
94{ 94{
95 int wordsize = codec->driver->reg_word_size * 2; 95 int wordsize = min_bytes_needed(codec->driver->reg_cache_size) * 2;
96 int regsize = min_bytes_needed(codec->driver->reg_cache_size) * 2; 96 int regsize = codec->driver->reg_word_size * 2;
97 int ret; 97 int ret;
98 char tmpbuf[len + 1]; 98 char tmpbuf[len + 1];
99 char regbuf[regsize + 1]; 99 char regbuf[regsize + 1];
@@ -132,8 +132,8 @@ static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf,
132 size_t total = 0; 132 size_t total = 0;
133 loff_t p = 0; 133 loff_t p = 0;
134 134
135 wordsize = codec->driver->reg_word_size * 2; 135 wordsize = min_bytes_needed(codec->driver->reg_cache_size) * 2;
136 regsize = min_bytes_needed(codec->driver->reg_cache_size) * 2; 136 regsize = codec->driver->reg_word_size * 2;
137 137
138 len = wordsize + regsize + 2 + 1; 138 len = wordsize + regsize + 2 + 1;
139 139