Skip to content

Commit eb4b8ec

Browse files
Milo SpadaciniBartosz Golaszewski
authored andcommitted
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>
1 parent ac9a786 commit eb4b8ec

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/gpio/lsgpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static void print_attributes(struct gpio_v2_line_info *info)
9494
for (i = 0; i < info->num_attrs; i++) {
9595
if (info->attrs[i].id == GPIO_V2_LINE_ATTR_ID_DEBOUNCE)
9696
fprintf(stdout, ", debounce_period=%dusec",
97-
info->attrs[0].debounce_period_us);
97+
info->attrs[i].debounce_period_us);
9898
}
9999
}
100100

0 commit comments

Comments
 (0)