serdev_device_alloc(9)
π serdev_device_alloc(9) π
Hey bestie, welcome to the Kernel API Manual β¨ β this is the one about serdev_device_alloc, and ngl it's a short one but it's lowkey important, so let's get into it π«Ά
πΈ NAME πΈ
serdev_device_alloc β allocate a new serdev device π
β¨ SYNOPSIS β¨
struct serdev_device * serdev_device_alloc (struct serdev_controller
*ctrl );
π¦ ARGUMENTS π¦
ctrlβ the associated controller π« (like, the controller this new device is being tied to, iykyk)
π DESCRIPTION π
So here's the vibe check: this function allocates you a brand-new serdev device β¨. But bestie, listen β the caller is responsible for what happens next π. You've got exactly two moves, and you gotta pick one, no cap:
- call
serdev_device_addto add the newly allocated controller π, or - call
serdev_device_putto discard it π
That's it. That's the whole responsibility. Don't just leave it floating there, okay? π
π₯ SEE ALSO π₯
Kernel file ./drivers/tty/serdev/core.c plus all these iconic little friends:
serdev_device_add(9)serdev_device_remove(9)serdev_device_write_buf(9)serdev_device_write(9)serdev_controller_alloc(9)of_find_serdev_controller_by_node(9)serdev_acpi_get_uart_resource(9)serdev_controller_add(9)serdev_controller_remove(9)__serdev_device_driver_register(9)
Okay that's the whole page, you ate that π This little gem lives over in ./drivers/tty/serdev, and the version we're serving you is from October 2026 β stay slay, stay allocated, and remember to free your stuff, bestie ππ
π¦ 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