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

Configure Feed

Select the types of activity you want to include in your feed.

gpio: cgbc: 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 cgbc_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-2-dmitry.torokhov@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

authored by

Dmitry Torokhov and committed by
Bartosz Golaszewski
49621f1c c4377868

+2 -2
+2 -2
drivers/gpio/gpio-cgbc.c
··· 47 47 48 48 if (ret) 49 49 return ret; 50 - else 51 - return (int)(val & (u8)BIT(offset)); 50 + 51 + return !!(val & BIT(offset)); 52 52 } 53 53 54 54 static int __cgbc_gpio_set(struct gpio_chip *chip, unsigned int offset,