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: bd9571mwv: 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 bd9571mwv_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-1-dmitry.torokhov@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

authored by

Dmitry Torokhov and committed by
Bartosz Golaszewski
c4377868 2c299030

+1 -1
+1 -1
drivers/gpio/gpio-bd9571mwv.c
··· 69 69 if (ret < 0) 70 70 return ret; 71 71 72 - return val & BIT(offset); 72 + return !!(val & BIT(offset)); 73 73 } 74 74 75 75 static int bd9571mwv_gpio_set(struct gpio_chip *chip, unsigned int offset,