mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 12:53:14 +01:00
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
This commit is contained in:
1 parent
5a32ebabb6
commit
e62b94a690
1 file changed
+1
-1
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user