diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2026-02-18 22:06:55 +0300 |
|---|---|---|
| committer | Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> | 2026-02-23 12:41:43 +0300 |
| commit | 9eb7ecfd20f868421e44701274896ba9e136daae (patch) | |
| tree | 027e6d921a8d1703e16783c577be7f24b76e61fa | |
| parent | e62b94a690c8cd7050c3d308e01ee1b24ee9bb0b (diff) | |
| download | linux-9eb7ecfd20f868421e44701274896ba9e136daae.tar.xz | |
gpio: tps65086: 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 tps65086_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-6-dmitry.torokhov@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
| -rw-r--r-- | drivers/gpio/gpio-tps65086.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-tps65086.c b/drivers/gpio/gpio-tps65086.c index 84b17b83476f..df770ecf28bc 100644 --- a/drivers/gpio/gpio-tps65086.c +++ b/drivers/gpio/gpio-tps65086.c @@ -50,7 +50,7 @@ static int tps65086_gpio_get(struct gpio_chip *chip, unsigned offset) if (ret < 0) return ret; - return val & BIT(4 + offset); + return !!(val & BIT(4 + offset)); } static int tps65086_gpio_set(struct gpio_chip *chip, unsigned int offset, |
