]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: sysfs: correct error handling on 'value' attribute read.
authorChristophe Leroy <christophe.leroy@c-s.fr>
Mon, 18 Dec 2017 10:08:31 +0000 (11:08 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 20 Dec 2017 09:33:21 +0000 (10:33 +0100)
commit0a8a57bc90711d0aa27014cd521df92e4d37c254
tree779f856770f7759d7f15bd29c9717e44208be691
parentfde3d342b3895bc81db9574a5cc852b1d980c7d4
gpio: sysfs: correct error handling on 'value' attribute read.

'value' attribute is supposed to only return 0 or 1 according to
the documentation.
With today's implementation, if gpiod_get_value_cansleep() fails
the printed 'value' is a negative value.

This patch ensures that an error is returned on read instead.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib-sysfs.c