gpio: improve the API contract for setting direction
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 25 Jan 2024 08:35:07 +0000 (09:35 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 29 Jan 2024 10:45:49 +0000 (11:45 +0100)
commit6933ba529d06afdd3faf5501855e410b46b77160
treec1cd919e34933f98ede5577a4016af050a658957
parent88b7049635dc5d0e2a7dfaaf89e70a9654ed6561
gpio: improve the API contract for setting direction

If a GPIO driver returns a positive integer from one of the direction
setter callbacks, we'll end up propagating it to user-space. Whether we
should sanitize the values returned by callbacks is a different question
but let's first improve the documentation and fortify the contract with
GPIO providers.

Reported-by: José Guilherme de Castro Rodrigues <joseguilhermebh@hotmail.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Kent Gibson <warthog618@gmail.com>
include/linux/gpio/driver.h