Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <dmitry.torokhov@gmail.com>
Link: https://patch.msgid.link/20260218190657.2974723-3-dmitry.torokhov@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

authored by

Dmitry Torokhov and committed by
Bartosz Golaszewski
4d720b0d 49621f1c

+1 -1
+1 -1
drivers/gpio/gpio-da9055.c
··· 55 55 return ret; 56 56 } 57 57 58 - return ret & (1 << offset); 58 + return !!(ret & (1 << offset)); 59 59 60 60 } 61 61