diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2026-02-18 22:06:54 +0300 |
|---|---|---|
| committer | Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> | 2026-02-23 12:41:43 +0300 |
| commit | e62b94a690c8cd7050c3d308e01ee1b24ee9bb0b (patch) | |
| tree | c86329e6c7b0908135b2bef7d98b0896c98c6c95 | |
| parent | 5a32ebabb6819fafce99e7bc6575ca568af6d22a (diff) | |
| download | linux-e62b94a690c8cd7050c3d308e01ee1b24ee9bb0b.tar.xz | |
gpio: stp-xway: 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 xway_stp_get() is normalized
to the [0, 1] range.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://patch.msgid.link/20260218190657.2974723-5-dmitry.torokhov@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
| -rw-r--r-- | drivers/gpio/gpio-stp-xway.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-stp-xway.c b/drivers/gpio/gpio-stp-xway.c index 493c027afdd6..78d6c78d4aab 100644 --- a/drivers/gpio/gpio-stp-xway.c +++ b/drivers/gpio/gpio-stp-xway.c @@ -102,7 +102,7 @@ static int xway_stp_get(struct gpio_chip *gc, unsigned int gpio) { struct xway_stp *chip = gpiochip_get_data(gc); - return (xway_stp_r32(chip->virt, XWAY_STP_CPU0) & BIT(gpio)); + return !!(xway_stp_r32(chip->virt, XWAY_STP_CPU0) & BIT(gpio)); } /** |
