Skip to content

Commit 2b5ae9c

Browse files
andy-shevBartosz Golaszewski
authored andcommitted
gpiolib: Discourage to use formatting strings in line names
Currently the documentation for line names allows to use %u inside the alternative name. This is broken in character device approach from day 1 and being in use solely in sysfs. Character device interface has a line number as a part of its address, so the users better rely on it. Hence remove the misleading documentation. On top of that, there are no in-kernel users (out of 6, if I'm correct) for such names and moreover if one exists it won't help in distinguishing lines with the same naming as '%u' will also be in them and we will get a warning in gpiochip_set_desc_names() for such cases. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Kent Gibson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 68a25c3 commit 2b5ae9c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

include/linux/gpio/driver.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,7 @@ struct gpio_irq_chip {
376376
* @names: if set, must be an array of strings to use as alternative
377377
* names for the GPIOs in this chip. Any entry in the array
378378
* may be NULL if there is no alias for the GPIO, however the
379-
* array must be @ngpio entries long. A name can include a single printk
380-
* format specifier for an unsigned int. It is substituted by the actual
381-
* number of the gpio.
379+
* array must be @ngpio entries long.
382380
* @can_sleep: flag must be set iff get()/set() methods sleep, as they
383381
* must while accessing GPIO expander chips over I2C or SPI. This
384382
* implies that if the chip supports IRQs, these IRQs need to be threaded

0 commit comments

Comments
 (0)