Skip to content

Commit 803e822

Browse files
linuswBartosz Golaszewski
authored andcommitted
gpiolib: Update gpiochip_find_base_unlocked() kerneldoc
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>
1 parent 8a36138 commit 803e822

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

drivers/gpio/gpiolib.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,15 @@ struct gpio_chip *gpio_device_get_chip(struct gpio_device *gdev)
338338
}
339339
EXPORT_SYMBOL_GPL(gpio_device_get_chip);
340340

341-
/* dynamic allocation of GPIOs, e.g. on a hotplugged device */
341+
/**
342+
* gpiochip_find_base_unlocked() - Find a global GPIO number base
343+
* @ngpio: Number of consecutive GPIOs to number
344+
*
345+
* Finds and allocates a consecutive range of unsigned integers representing
346+
* the GPIOs on the system. Using this numberspace outside of gpiolibs
347+
* internals is STRONGLY DISCOURAGED, drivers and consumers should NOT concern
348+
* themselves with this numberspace.
349+
*/
342350
static int gpiochip_find_base_unlocked(u16 ngpio)
343351
{
344352
unsigned int base = GPIO_DYNAMIC_BASE;

0 commit comments

Comments
 (0)