[PATCH 3/7] gpio: da9055: normalize return value of gpio_get
From: Dmitry Torokhov
Date: Wed Feb 18 2026 - 14:07:24 EST
The GPIO get callback is expected to return 0 or 1 (or a negative error
code). Ensure that the value returned by da9055_gpio_get() is normalized
to the [0, 1] range.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
---
drivers/gpio/gpio-da9055.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-da9055.c b/drivers/gpio/gpio-da9055.c
index a09bd6eb93cf..1949a6ea8ec6 100644
--- a/drivers/gpio/gpio-da9055.c
+++ b/drivers/gpio/gpio-da9055.c
@@ -55,7 +55,7 @@ static int da9055_gpio_get(struct gpio_chip *gc, unsigned offset)
return ret;
}
- return ret & (1 << offset);
+ return !!(ret & (1 << offset));
}
--
2.53.0.335.g19a08e0c02-goog