]> git.ipfire.org Git - thirdparty/linux.git/commit
gpiolib: don't allow setting values on input lines
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 11 Mar 2025 14:19:51 +0000 (15:19 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 7 Apr 2025 07:00:48 +0000 (09:00 +0200)
commit92ac7de3175e3c17cbb76ae752b598cfb9dadf49
treedc4eb8139c917a274af8774f15f6089ebdc16697
parent0af2f6be1b4281385b618cb86ad946eded089ac8
gpiolib: don't allow setting values on input lines

Some drivers as well as the character device and sysfs code check
whether the line actually is in output mode before allowing the user to
set a value.

However, GPIO value setters now return integer values and can indicate
failures. This allows us to move these checks into the core code.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250311-gpio-set-check-output-v1-1-d971bca9e6fa@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpiolib-cdev.c
drivers/gpio/gpiolib-sysfs.c
drivers/gpio/gpiolib.c