Commit 723a6303 authored by Linus Walleij's avatar Linus Walleij

Revert "gpio: revert get() to non-errorprogating behaviour"

This reverts commit 45ad7db9.

We have fixed all the drivers that were returning ambious values
not clamped to [0,1] or an error code, so return the error
propagating behaviour of the API.
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 39e24ac3
...@@ -1303,13 +1303,7 @@ static int _gpiod_get_raw_value(const struct gpio_desc *desc) ...@@ -1303,13 +1303,7 @@ static int _gpiod_get_raw_value(const struct gpio_desc *desc)
chip = desc->chip; chip = desc->chip;
offset = gpio_chip_hwgpio(desc); offset = gpio_chip_hwgpio(desc);
value = chip->get ? chip->get(chip, offset) : -EIO; value = chip->get ? chip->get(chip, offset) : -EIO;
/* value = value < 0 ? value : !!value;
* FIXME: fix all drivers to clamp to [0,1] or return negative,
* then change this to:
* value = value < 0 ? value : !!value;
* so we can properly propagate error codes.
*/
value = !!value;
trace_gpio_value(desc_to_gpio(desc), 1, value); trace_gpio_value(desc_to_gpio(desc), 1, value);
return value; return value;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment