mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +00:00
ASoC: intel: skl: Fix pin debug prints
commit64bbacc5f0upstream. 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:d14700a01f("ASoC: Intel: Skylake: Debugfs facility to dump module config") Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20200218111737.14193-2-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
488c6c340d
commit
1dd4d68f19
@@ -34,7 +34,7 @@ static ssize_t skl_print_pins(struct skl_module_pin *m_pin, char *buf,
|
|||||||
int i;
|
int i;
|
||||||
ssize_t ret = 0;
|
ssize_t ret = 0;
|
||||||
|
|
||||||
for (i = 0; i < max_pin; i++)
|
for (i = 0; i < max_pin; i++) {
|
||||||
ret += snprintf(buf + size, MOD_BUF - size,
|
ret += snprintf(buf + size, MOD_BUF - size,
|
||||||
"%s %d\n\tModule %d\n\tInstance %d\n\t"
|
"%s %d\n\tModule %d\n\tInstance %d\n\t"
|
||||||
"In-used %s\n\tType %s\n"
|
"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,
|
|||||||
m_pin[i].in_use ? "Used" : "Unused",
|
m_pin[i].in_use ? "Used" : "Unused",
|
||||||
m_pin[i].is_dynamic ? "Dynamic" : "Static",
|
m_pin[i].is_dynamic ? "Dynamic" : "Static",
|
||||||
m_pin[i].pin_state, i);
|
m_pin[i].pin_state, i);
|
||||||
|
size += ret;
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user