Skip to content

Commit eb4b8ec

Browse files
Milo SpadaciniBartosz Golaszewski
Milo Spadacini
authored and
Bartosz Golaszewski
committed
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 <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent ac9a786 commit eb4b8ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/gpio/lsgpio.c

+1-1
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)