summaryrefslogtreecommitdiffstats
path: root/tools/gpio
diff options
context:
space:
mode:
authorMilo Spadacini <milo.spadacini@gmail.com>2023-05-08 15:18:48 +0200
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>2023-05-11 10:56:24 +0200
commiteb4b8eca1bad98f4b8574558a74f041f9acb5a54 (patch)
tree059300baa6433bf6e228ff5319b980868034a056 /tools/gpio
parentLinux 6.4-rc1 (diff)
downloadlinux-eb4b8eca1bad98f4b8574558a74f041f9acb5a54.tar.xz
linux-eb4b8eca1bad98f4b8574558a74f041f9acb5a54.zip
tools: gpio: fix debounce_period_us output of lsgpio
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> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'tools/gpio')
-rw-r--r--tools/gpio/lsgpio.c2
1 files changed, 1 insertions, 1 deletions
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);
}
}