Linux GPIO subsystem development
 help / color / mirror / Atom feed
* [PATCH v3] tools: gpio: fix debounce_period_us output of lsgpio
@ 2023-05-08 13:18 Milo Spadacini
  2023-05-08 13:46 ` Linus Walleij
  2023-05-11  8:56 ` Bartosz Golaszewski
  0 siblings, 2 replies; 4+ messages in thread
From: Milo Spadacini @ 2023-05-08 13:18 UTC (permalink / raw)
  To: linus.walleij, brgl, linux-gpio, warthog618, andy.shevchenko
  Cc: Milo Spadacini

Fix incorrect output that could occur when more attributes are used and
GPIO_V2_LINE_ATTR_ID_DEBOUNCE is not the first one.

Signed-off-by: Milo Spadacini <milo.spadacini@gmail.com>
---
V2 -> V3 add signature
V1 -> V2 fix commit syntax
---
 tools/gpio/lsgpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/gpio/lsgpio.c b/tools/gpio/lsgpio.c
index c61d061247e1..52a0be45410c 100644
--- a/tools/gpio/lsgpio.c
+++ b/tools/gpio/lsgpio.c
@@ -94,7 +94,7 @@ static void print_attributes(struct gpio_v2_line_info *info)
 	for (i = 0; i < info->num_attrs; i++) {
 		if (info->attrs[i].id == GPIO_V2_LINE_ATTR_ID_DEBOUNCE)
 			fprintf(stdout, ", debounce_period=%dusec",
-				info->attrs[0].debounce_period_us);
+				info->attrs[i].debounce_period_us);
 	}
 }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-05-11  8:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-08 13:18 [PATCH v3] tools: gpio: fix debounce_period_us output of lsgpio Milo Spadacini
2023-05-08 13:46 ` Linus Walleij
2023-05-08 14:37   ` Andy Shevchenko
2023-05-11  8:56 ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox