Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: Milo Spadacini <milo.spadacini@gmail.com>
To: linus.walleij@linaro.org, brgl@bgdev.pl,
	linux-gpio@vger.kernel.org, warthog618@gmail.com,
	andy.shevchenko@gmail.com
Cc: Milo Spadacini <milo.spadacini@gmail.com>
Subject: [PATCH v3] tools: gpio: fix debounce_period_us output of lsgpio
Date: Mon,  8 May 2023 15:18:48 +0200	[thread overview]
Message-ID: <20230508131848.142602-1-milo.spadacini@gmail.com> (raw)

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


             reply	other threads:[~2023-05-08 13:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-08 13:18 Milo Spadacini [this message]
2023-05-08 13:46 ` [PATCH v3] tools: gpio: fix debounce_period_us output of lsgpio Linus Walleij
2023-05-08 14:37   ` Andy Shevchenko
2023-05-11  8:56 ` Bartosz Golaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230508131848.142602-1-milo.spadacini@gmail.com \
    --to=milo.spadacini@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=warthog618@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox