tty_port_re..._device_attr(9)
β¨ tty_port_register_device_attr(9) β¨
okay bestie, buckle up π this one's from the Kernel API Manual, and it's genuinely so useful once it clicks, i promise.
πΈ NAME πΈ
tty_port_register_device_attr β register tty device π
π¦ SYNOPSIS π¦
struct device * tty_port_register_device_attr (struct tty_port *port ,
struct tty_driver *driver , unsigned index , struct device *device ,
void *drvdata , const struct attribute_group **attr_grp );
like, six whole arguments, she's a lot but she's worth it π
π ARGUMENTS π
portβ thetty_portof the device π«Άdriverβ thetty_driverfor this deviceindexβ the index of the tty, aka which one she isdeviceβ the parent, if there is one; otherwiseNULLπdrvdataβ the driver data that gets set to the deviceattr_grpβ the attribute group to be set on the device β¨
π DESCRIPTION π
okay so, literally, it's the same as tty_register_device_attr β except the provided port is linked to a concrete tty specified by index. that's the whole vibe check π¦
use this one, or tty_port_install (or both, honestly, go off π). and call tty_port_link_device as a last resort, like only if nothing else works, no cap π
π SEE ALSO π
kernel file ./drivers/tty/tty_port.c β and here's the whole squad, they all ate fr fr:
tty_port_init(9)tty_port_link_wq(9)tty_port_link_device(9)tty_port_register_device(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)
ngl bestie, that's the whole page π go forth and register those ttys πΈ
and that's a wrap, mwah π β this little gem lives in ./drivers/tty, dated October 2026, and it's page tty_port_re..._device_attr(9) of the Kernel API Manual. slay πβ¨
π¦ 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