power: supply: sbs-manager: normalize return value of gpio_get
Subsystems (2)
PATCH 1/1 power: supply: sbs-manager: 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 sbsm_gpio_get_value() is normalized to the [0, 1] range.
--- drivers/power/supply/sbs-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/sbs-manager.c +1 -1
@@ -199,7 +199,7 @@ static int sbsm_gpio_get_value(struct gpio_chip *gc, unsigned int off)if (ret <0 )return ret; -return ret &BIT (off); +return !!(ret &BIT (off)); }/*
Signature · 5 lines
2.53.0.335.g19a08e0c02-goog -- Dmitry
Quoted 26 lines · Dmitry Torokhov
The GPIO get callback is expected to return 0 or 1 (or a negative error code). Ensure that the value returned by
sbsm_gpio_get_value()is normalized to the [0, 1] range.Signed-off-by Dmitry Torokhov <[email protected]>--- drivers/power/supply/sbs-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/power/supply/sbs-manager.c +1
-2@@ -199,7 +199,7 @@ static int sbsm_gpio_get_value(struct gpio_chip *gc, unsigned int off)if (ret <0 )return ret; -return ret &BIT (off); +return !!(ret &BIT (off)); }/* -- 2.53.0.335.g19a08e0c02-goog
Quoted 3 lines
--
Dmitry
Quoted 5 lines · Dmitry Torokhov
The GPIO get callback is expected to return 0 or 1 (or a negative error code). Ensure that the value returned by
sbsm_gpio_get_value()is normalized to the [0, 1] range.Signed-off-by Dmitry Torokhov <[email protected]>
Yours,
Linus Walleij
Sebastian Reichel
AppliedQuoted 5 lines · Dmitry Torokhov
The GPIO get callback is expected to return 0 or 1 (or a negative error code). Ensure that the value returned by
sbsm_gpio_get_value()is normalized to the [0, 1] range.
Applied, thanks!
[1/1] power: supply: sbs-manager: normalize return value of gpio_get
commit: b4512ae0d55a5632294a16eae765e8b4c41b8856
Best regards,
Signature · 1 line
Sebastian Reichel <[email protected]>