tty_port_init(9)
β¨ tty_port_init(9) β¨
okay so we're in the Kernel API Manual today bestie, and the star of the show is tty_port_init π
buckle up.
πΈ NAME πΈ
tty_port_init β initialize tty_port
like, it initializes a tty_port. that's the whole vibe. no cap.
π¦ SYNOPSIS π¦
void tty_port_init (struct tty_port *port );
π ARGUMENTS π
portβ thetty_portyou wanna initialize. that's it. that's the argument. she's simple, she's iconic π«Ά
π DESCRIPTION π
So tty_port_init initializes the state of struct tty_port β¨ like it sets up the whole situation so your port is ready to be a main character.
But listen β this is the important part β once a port has been initialized using this function, you have to destroy the port by tty_port_destroy. you can't just leave it there, that's giving unfinished business π
and you've got options on how to do the destroying, bestie:
- indirectly, by using
tty_portrefcounting (tty_port_put) β the chill, let-the-refcount-handle-it route π - directly, if refcounting is not used β the do-it-yourself route π«‘
either way, the port gets destroyed. no skipping this step. periodt.
π₯ SEE ALSO π₯
Kernel file ./drivers/tty/tty_port.c β go read the source, iykyk π and while you're at it, here's the whole friend group:
tty_port_link_wq(9)tty_port_link_device(9)tty_port_register_device(9)tty_port_register_device_attr(9)tty_port_register_device_attr_serdev(9)tty_port_unregister_device(9)tty_port_destroy(9)tty_port_put(9)tty_port_tty_get(9)tty_port_tty_set(9)tty_port_shutdown(9)tty_port_hangup(9)tty_port_tty_hangup(9)tty_port_tty_vhangup(9)tty_port_tty_wakeup(9)tty_port_carrier_raised(9)tty_port_raise_dtr_rts(9)tty_port_lower_dtr_rts(9)tty_port_block_til_ready(9)tty_port_close_start(9)tty_port_close_end(9)tty_port_close(9)tty_port_install(9)tty_port_open(9)
like, the whole squad. go say hi ππ
anyway that's the page π§ this one lives in ./drivers/tty and it's dated October 2026, and the page is literally called tty_port_init(9) β slay, go initialize something responsibly πβ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms