gpio: Fix pin's status display for pin with GPIOF_UNUSED function

Even pin with GPIOF_UNUSED function can have a label.
The criteria to add or not a space character is linked to label not to
the used/unused status.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
This commit is contained in:
Patrice Chotard 2022-08-30 14:09:12 +02:00 committed by Tom Rini
parent d7124f0ba4
commit a32920897a

View File

@ -916,7 +916,7 @@ int gpio_get_status(struct udevice *dev, int offset, char *buf, int buffsize)
snprintf(str + len, buffsize - len, ": %d [%c]%s%s", snprintf(str + len, buffsize - len, ": %d [%c]%s%s",
ret, ret,
used ? 'x' : ' ', used ? 'x' : ' ',
used ? " " : "", label ? " " : "",
label ? label : ""); label ? label : "");
break; break;
} }