]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpiolib: Update gpiochip_find_base_unlocked() kerneldoc
authorLinus Walleij <linusw@kernel.org>
Wed, 11 Mar 2026 09:42:14 +0000 (10:42 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Mon, 16 Mar 2026 08:53:25 +0000 (09:53 +0100)
This function albeit static was lacking a kerneldoc, and the
function returns a dangerous number for internal use so make
that clear in the kerneldoc.

Reported-by: Matthijs Kooijman <matthijs@stdin.nl>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260311-gpio-discourage-dynamic-v1-1-c8b68fc84203@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
drivers/gpio/gpiolib.c

index 56fda7891d5546ef423513e419f8a673ddcef72c..e287ab0d21fc40c1e172528210a85d28f686a9f6 100644 (file)
@@ -338,7 +338,15 @@ struct gpio_chip *gpio_device_get_chip(struct gpio_device *gdev)
 }
 EXPORT_SYMBOL_GPL(gpio_device_get_chip);
 
-/* dynamic allocation of GPIOs, e.g. on a hotplugged device */
+/**
+ * gpiochip_find_base_unlocked() - Find a global GPIO number base
+ * @ngpio: Number of consecutive GPIOs to number
+ *
+ * Finds and allocates a consecutive range of unsigned integers representing
+ * the GPIOs on the system. Using this numberspace outside of gpiolibs
+ * internals is STRONGLY DISCOURAGED, drivers and consumers should NOT concern
+ * themselves with this numberspace.
+ */
 static int gpiochip_find_base_unlocked(u16 ngpio)
 {
        unsigned int base = GPIO_DYNAMIC_BASE;