Skip to content

Commit

Permalink
tools: gpio: fix debounce_period_us output of lsgpio
Browse files Browse the repository at this point in the history
[ Upstream commit eb4b8ec ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Milo Spadacini authored and gregkh committed Jun 21, 2023
1 parent e949f90 commit 3ee6094
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/gpio/lsgpio.c
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 3ee6094

Please sign in to comment.