Skip to content

Commit 11ff5e0

Browse files
andredBartosz Golaszewski
authored andcommitted
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 d1d52c6 ("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: d1d52c6 ("gpiolib: devres: Finish the conversion to use devm_add_action()") Signed-off-by: André Draszik <[email protected]> Reported-by: Wattson CI <[email protected]> Reported-by: Samuel Wu <[email protected]> Link: https://lore.kernel.org/r/20250715-gpiolib-devres-put-array-fix-v1-1-970d82a8c887@linaro.org Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent e31c8f1 commit 11ff5e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpio/gpiolib-devres.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ EXPORT_SYMBOL_GPL(devm_gpiod_unhinge);
319319
*/
320320
void devm_gpiod_put_array(struct device *dev, struct gpio_descs *descs)
321321
{
322-
devm_remove_action(dev, devm_gpiod_release_array, descs);
322+
devm_release_action(dev, devm_gpiod_release_array, descs);
323323
}
324324
EXPORT_SYMBOL_GPL(devm_gpiod_put_array);
325325

0 commit comments

Comments
 (0)