From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B86685381 for ; Mon, 19 Jun 2023 10:43:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E70AC433C8; Mon, 19 Jun 2023 10:43:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1687171392; bh=e7tWL6wTRy34K2JWIZX6jDI78R1WuLGLxqA768ehrHA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oLOfbrRjvF/9KaIRYjsVSKmsaRgj1SGz9mCBxkQNr8x1deaFecbGl9Tq+ccVIDgx0 rCHzqgKM8KouGnSGje0fC6u+EE0pmUgQWWu8saWC3VGHr+uq76NVfl3yGwbcXq1ccs dgI/rB72ZwlJq2pqToKb9BtXd3McZ+APujNtUAsE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Milo Spadacini , Linus Walleij , Andy Shevchenko , Bartosz Golaszewski , Sasha Levin Subject: [PATCH 6.1 015/166] tools: gpio: fix debounce_period_us output of lsgpio Date: Mon, 19 Jun 2023 12:28:12 +0200 Message-ID: <20230619102155.439874317@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230619102154.568541872@linuxfoundation.org> References: <20230619102154.568541872@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Milo Spadacini [ Upstream commit eb4b8eca1bad98f4b8574558a74f041f9acb5a54 ] 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 Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin --- 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 c61d061247e17..52a0be45410c9 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.39.2