Commit a4f56726 authored by André Draszik's avatar André Draszik Committed by André Draszik
Browse files

FROMGIT: gpiolib: devres: release GPIOs in devm_gpiod_put_array()



devm_gpiod_put_array() is meant to undo the effects of
devm_gpiod_get_array() - in particular, it should release the GPIOs
contained in the array acquired with the latter. It is meant to be the
resource-managed version of gpiod_put_array(), and it should behave
similar to the non-array version devm_gpiod_put().

Since commit d1d52c66 ("gpiolib: devres: Finish the conversion to
use devm_add_action()") it doesn't do that anymore, it just removes the
devres action and frees associated memory, but it doesn't actually
release the GPIOs.

Fix by switching from devm_remove_action() to devm_release_action(),
which will in addition invoke the action to release the GPIOs.

Fixes: d1d52c66 ("gpiolib: devres: Finish the conversion to use devm_add_action()")
Signed-off-by: default avatarAndré Draszik <andre.draszik@linaro.org>
Link: https://lore.kernel.org/r/20250715-gpiolib-devres-put-array-fix-v1-1-970d82a8c887@linaro.org


Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Test: TH
Bug: 427582856
Bug: 428651697
(cherry picked from commit ff20798820e08af0fe757c756914b4aa51993ccb
 https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git

 gpio/for-current)
Change-Id: I26faaa448cdccb9d89d0bce3cfc13b4684ccec6f
Signed-off-by: default avatarAndré Draszik <draszik@google.com>
parent ea989f2e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment