]> www.infradead.org Git - users/hch/misc.git/commitdiff
gpio: deprecate devm_gpiod_unhinge()
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 1 Apr 2025 12:46:43 +0000 (14:46 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 8 Apr 2025 08:41:58 +0000 (10:41 +0200)
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>
drivers/gpio/gpiolib-devres.c

index 08205f355cebe57e9f61b3947b71ab08ec1d9fc2..120d1ec5af3bd663cdd473f660c5aeeab157763d 100644 (file)
@@ -317,11 +317,15 @@ EXPORT_SYMBOL_GPL(devm_gpiod_put);
  * @dev:       GPIO consumer
  * @desc:      GPIO descriptor to remove resource management from
  *
+ * *DEPRECATED*
+ * This function should not be used. It's been provided as a workaround for
+ * resource ownership issues in the regulator framework and should be replaced
+ * with a better solution.
+ *
  * Remove resource management from a GPIO descriptor. This is needed when
  * you want to hand over lifecycle management of a descriptor to another
  * mechanism.
  */
-
 void devm_gpiod_unhinge(struct device *dev, struct gpio_desc *desc)
 {
        int ret;