public inbox for linux-gpio@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio: amd-fch: Return 0-1 range for get operation
@ 2026-01-29 22:21 Rory Little
  2026-01-30  5:07 ` kernel test robot
  2026-01-30  6:03 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Rory Little @ 2026-01-29 22:21 UTC (permalink / raw)
  To: Enrico Weigelt; +Cc: linux-gpio

Now that gpiochip_get sanitizes the output of these calls, this old
non-1 behavior was causing -EBADE to be returned when voltage high was
read.

Signed-off-by: Rory Little <rory@candelatech.com>
---
 drivers/gpio/gpio-amd-fch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-amd-fch.c b/drivers/gpio/gpio-amd-fch.c
index e6c6c3ec7656..37bf1842481d 100644
--- a/drivers/gpio/gpio-amd-fch.c
+++ b/drivers/gpio/gpio-amd-fch.c
@@ -125,7 +125,7 @@ static int amd_fch_gpio_get(struct gpio_chip *gc,
 	void __iomem *ptr = amd_fch_gpio_addr(priv, offset);
 
 	spin_lock_irqsave(&priv->lock, flags);
-	ret = (readl_relaxed(ptr) & AMD_FCH_GPIO_FLAG_READ);
+	ret = FIELD_GET(AMD_FCH_GPIO_FLAG_READ, readl_relaxed(ptr));
 	spin_unlock_irqrestore(&priv->lock, flags);
 
 	return ret;
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-30  6:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-29 22:21 [PATCH] gpio: amd-fch: Return 0-1 range for get operation Rory Little
2026-01-30  5:07 ` kernel test robot
2026-01-30  6:03 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox