Skip to content

Commit 64bbacc

Browse files
tiwaibroonie
authored andcommitted
ASoC: intel: skl: Fix pin debug prints
skl_print_pins() loops over all given pins but it overwrites the text at the very same position while increasing the returned length. Fix this to show the all pin contents properly. Fixes: d14700a ("ASoC: Intel: Skylake: Debugfs facility to dump module config") Signed-off-by: Takashi Iwai <[email protected]> Acked-by: Cezary Rojewski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 310006c commit 64bbacc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sound/soc/intel/skylake/skl-debug.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static ssize_t skl_print_pins(struct skl_module_pin *m_pin, char *buf,
3434
int i;
3535
ssize_t ret = 0;
3636

37-
for (i = 0; i < max_pin; i++)
37+
for (i = 0; i < max_pin; i++) {
3838
ret += snprintf(buf + size, MOD_BUF - size,
3939
"%s %d\n\tModule %d\n\tInstance %d\n\t"
4040
"In-used %s\n\tType %s\n"
@@ -45,6 +45,8 @@ static ssize_t skl_print_pins(struct skl_module_pin *m_pin, char *buf,
4545
m_pin[i].in_use ? "Used" : "Unused",
4646
m_pin[i].is_dynamic ? "Dynamic" : "Static",
4747
m_pin[i].pin_state, i);
48+
size += ret;
49+
}
4850
return ret;
4951
}
5052

0 commit comments

Comments
 (0)