]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: update gpiochip .get() callback description
authorVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Tue, 22 Dec 2015 14:37:28 +0000 (16:37 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Sat, 26 Dec 2015 21:28:43 +0000 (22:28 +0100)
commit56eae3f24b20e66dcb2add83b33edae3b7085325
tree9bd578c65dd61d662d43423e6a27786280f51956
parented1adccd53af5ce33265ad80b43772df0d22b426
gpio: update gpiochip .get() callback description

Since gpiochip .get() callback may return a negative error value, it
strictly limits the range of possible non-error returned values to
a subset of [30:0] bitmask, however on practice on success all
gpiochip drivers return either 0 for low signal or 1 for high signal,
this is assured by "gpio: *: Be sure to clamp return value" series of
changes. To avoid any confusion, misinterpretation and potential
errors while developing gpiochip drivers in future convert this
implicit assumption to a mandatory rule.

For output signals with unknown output signal state gpiochip drivers
should return a negative error instead of 0.

Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
include/linux/gpio/driver.h