Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 206604
b: refs/heads/master
c: 5164d74
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown committed Jul 14, 2010
1 parent da83498 commit 2da765f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 03b0dc02cf54a79d6bc2f49c0005bc07db5120a4
refs/heads/master: 5164d74d74447895aaa31c094a1b9e666acaa656
22 changes: 17 additions & 5 deletions trunk/sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static int run_delayed_work(struct delayed_work *dwork)
/* codec register dump */
static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf)
{
int i, step = 1, count = 0;
int ret, i, step = 1, count = 0;

if (!codec->reg_cache_size)
return 0;
Expand All @@ -101,12 +101,24 @@ static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf)
if (count >= PAGE_SIZE - 1)
break;

if (codec->display_register)
if (codec->display_register) {
count += codec->display_register(codec, buf + count,
PAGE_SIZE - count, i);
else
count += snprintf(buf + count, PAGE_SIZE - count,
"%4x", codec->read(codec, i));
} else {
/* If the read fails it's almost certainly due to
* the register being volatile and the device being
* powered off.
*/
ret = codec->read(codec, i);
if (ret >= 0)
count += snprintf(buf + count,
PAGE_SIZE - count,
"%4x", ret);
else
count += snprintf(buf + count,
PAGE_SIZE - count,
"<no data: %d>", ret);
}

if (count >= PAGE_SIZE - 1)
break;
Expand Down

0 comments on commit 2da765f

Please sign in to comment.