From: Dmitry Torokhov Date: Wed, 18 Feb 2026 19:06:52 +0000 (-0800) Subject: gpio: da9055: normalize return value of gpio_get X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d720b0d68e9a251d60804eace42aac800d7a79f;p=thirdparty%2Fkernel%2Flinux.git gpio: da9055: normalize return value of gpio_get 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 Link: https://patch.msgid.link/20260218190657.2974723-3-dmitry.torokhov@gmail.com Signed-off-by: Bartosz Golaszewski --- diff --git a/drivers/gpio/gpio-da9055.c b/drivers/gpio/gpio-da9055.c index a09bd6eb93cfb..1949a6ea8ec61 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)); }