diff mbox series

[2/3] gpio: Fix pin's status display for pin with GPIOF_UNUSED function

Message ID 20220802090910.277343-3-patrice.chotard@foss.st.com
State Superseded
Delegated to: Tom Rini
Headers show
Series gpio: update gpio_get_status() | expand

Commit Message

Patrice Chotard Aug. 2, 2022, 9:09 a.m. UTC
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>
---

 drivers/gpio/gpio-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass Aug. 2, 2022, 12:41 p.m. UTC | #1
On Tue, 2 Aug 2022 at 03:09, Patrice Chotard
<patrice.chotard@foss.st.com> wrote:
>
> 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>
> ---
>
>  drivers/gpio/gpio-uclass.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c
index d60e46159a..a00880e446 100644
--- a/drivers/gpio/gpio-uclass.c
+++ b/drivers/gpio/gpio-uclass.c
@@ -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",
 			 ret,
 			 used ? 'x' : ' ',
-			 used ? " " : "",
+			 label ? " " : "",
 			 label ? label : "");
 		break;
 	}