gpio: da9055: 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 da9055_gpio_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:
Dmitry Torokhov authored and Bartosz Golaszewski committed 2026-02-23 10:41:42 +01:00
1 parent 49621f1c97
commit 4d720b0d68
1 file changed
+1 -1
+1 -1
View File
@@ -55,7 +55,7 @@ static int da9055_gpio_get(struct gpio_chip *gc, unsigned offset)
return ret;
}
return ret & (1 << offset);
return !!(ret & (1 << offset));
}