serdev_device_alloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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_add to add the newly allocated controller πŸ‘‘, or
  • call serdev_device_put to 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:


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