STRUCT SERDEV_CONTROLLER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct serdev_controller(9) ✨

okay bestie, so this is a page straight out of the Kernel API Manual and it's literally about struct serdev_controller β€” the interface to the serdev controller πŸŽ€ ngl it's short but it's iconic, let's get into it.


🌸 NAME 🌸

struct serdev_controller β€” interface to the serdev controller. that's the whole vibe, she's the middle-woman between the driver model and your serial hardware 🫢


πŸŽ€ SYNOPSIS πŸŽ€

like, here's exactly what she looks like, no cap, copy it exactly:

struct serdev_controller {
    struct device           dev;
    struct device           *host;
    unsigned int            nr;
    struct serdev_device    *serdev;
    const struct serdev_controller_ops *ops;
 };

πŸ’– Members πŸ’–

so each of these fields is doing her own little job, let's break it down:

  • dev β€” the driver model representation of the device ✨ this is the struct device that shows up in the device model, she's got main character energy in sysfs.
  • host β€” serial port hardware controller device πŸ¦‹ a pointer to the struct device that is the actual serial port hardware controller.
  • nr β€” number identifier for this controller/bus πŸ”’ an unsigned int, and it's literally the number id for this controller/bus, iykyk.
  • serdev β€” pointer to slave device for this controller πŸ’œ a struct serdev_device *, the slave device hanging off this controller.
  • ops β€” controller operations 🎯 a const struct serdev_controller_ops *, aka the ops, the whole point.

πŸ¦‹ SEE ALSO πŸ¦‹

if you're gonna stan this struct you have to check her friends, they're all in the kernel file ./include/linux/serdev.h πŸ“:


fr fr go read ./include/linux/serdev.h before you touch any of this, she's the source of truth πŸ’€

and that's the page bestie, we're done πŸ’… mwah! this one came from ./include/linux, dated October 2026, and yes the title was struct serdev_controller(9) the whole time β€” slay, go build something πŸ”₯πŸ‘‘

πŸ“¦ where this page comes from