Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tty: tty_driver: document both {,__}tty_alloc_driver() properly

__tty_alloc_driver()'s kernel-doc needed some care: describe the return
value using the standard "Returns:", and use the new enum tty_driver_flag
for @flags.

Then, the tty_alloc_driver() macro was undocumented, but referenced many
times in the docs. Copy the docs from the above (except the @owner
parameter, obviously).

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20250317070046.24386-15-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
63f3cd5d 109e06ae

+14 -4
+2
Documentation/driver-api/tty/tty_driver.rst
··· 25 25 For reference, both allocation and deallocation functions are explained here in 26 26 detail: 27 27 28 + .. kernel-doc:: include/linux/tty_driver.h 29 + :identifiers: tty_alloc_driver 28 30 .. kernel-doc:: drivers/tty/tty_io.c 29 31 :identifiers: __tty_alloc_driver tty_driver_kref_put 30 32
+5 -3
drivers/tty/tty_io.c
··· 3329 3329 * __tty_alloc_driver - allocate tty driver 3330 3330 * @lines: count of lines this driver can handle at most 3331 3331 * @owner: module which is responsible for this driver 3332 - * @flags: some of %TTY_DRIVER_ flags, will be set in driver->flags 3332 + * @flags: some of enum tty_driver_flag, will be set in driver->flags 3333 3333 * 3334 - * This should not be called directly, some of the provided macros should be 3335 - * used instead. Use IS_ERR() and friends on @retval. 3334 + * This should not be called directly, tty_alloc_driver() should be used 3335 + * instead. 3336 + * 3337 + * Returns: struct tty_driver or a PTR-encoded error (use IS_ERR() and friends). 3336 3338 */ 3337 3339 struct tty_driver *__tty_alloc_driver(unsigned int lines, struct module *owner, 3338 3340 unsigned long flags)
+7 -1
include/linux/tty_driver.h
··· 564 564 565 565 void tty_driver_kref_put(struct tty_driver *driver); 566 566 567 - /* Use TTY_DRIVER_* flags below */ 567 + /** 568 + * tty_alloc_driver - allocate tty driver 569 + * @lines: count of lines this driver can handle at most 570 + * @flags: some of enum tty_driver_flag, will be set in driver->flags 571 + * 572 + * Returns: struct tty_driver or a PTR-encoded error (use IS_ERR() and friends). 573 + */ 568 574 #define tty_alloc_driver(lines, flags) \ 569 575 __tty_alloc_driver(lines, THIS_MODULE, flags) 570 576