Skip to contentSkip to conversation

gpiolib: Update gpiochip_find_base_unlocked() kerneldoc

PATCH Applied Linus Walleij 2 participants 2 messages Mar 11 – Mar 16 GPIO

lore
Share & tools
lore

Linus Walleij

author maintainer
#0 lore raw

PATCH 1/1 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.

---
Note to self: maybe this numberspace could be managed by a maple tree? It would be an interesting exercise.

---
 drivers/gpio/gpiolib.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpio/gpiolib.c +9 -1
index 86a171e96b0e..d9f8cf3022be 100644
@@ -340,7 +340,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;

---
base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
change-id: 20260311-gpio-discourage-dynamic-548c9271311d

Best regards,

Signature · 1 line
Linus Walleij <[email protected]>