Skip to content

Commit 686e54e

Browse files
author
Bartosz Golaszewski
committed
gpio: deprecate devm_gpiod_unhinge()
This function was introduced as a workaround for an issue with resource ownership in the regulator subsystem. Rather than passing the ownership of a GPIO, we should make the regulator core be able to deal with resources it didn't request. Deprecate this function so that we don't get more users in the tree. Link: https://lore.kernel.org/r/20250401-gpio-todo-remove-nonexclusive-v2-2-7c1380797b0d@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent 6deb843 commit 686e54e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/gpio/gpiolib-devres.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,15 @@ EXPORT_SYMBOL_GPL(devm_gpiod_put);
317317
* @dev: GPIO consumer
318318
* @desc: GPIO descriptor to remove resource management from
319319
*
320+
* *DEPRECATED*
321+
* This function should not be used. It's been provided as a workaround for
322+
* resource ownership issues in the regulator framework and should be replaced
323+
* with a better solution.
324+
*
320325
* Remove resource management from a GPIO descriptor. This is needed when
321326
* you want to hand over lifecycle management of a descriptor to another
322327
* mechanism.
323328
*/
324-
325329
void devm_gpiod_unhinge(struct device *dev, struct gpio_desc *desc)
326330
{
327331
int ret;

0 commit comments

Comments
 (0)