mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
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>
This commit is contained in:
parent
2c299030c6
commit
c437786805
|
|
@ -69,7 +69,7 @@ static int bd9571mwv_gpio_get(struct gpio_chip *chip, unsigned int offset)
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return val & BIT(offset);
|
||||
return !!(val & BIT(offset));
|
||||
}
|
||||
|
||||
static int bd9571mwv_gpio_set(struct gpio_chip *chip, unsigned int offset,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user