STRUCT SERDEV_CONTROLLER(9)
β¨ 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 thestruct devicethat shows up in the device model, she's got main character energy in sysfs.hostβ serial port hardware controller device π¦ a pointer to thestruct devicethat is the actual serial port hardware controller.nrβ number identifier for this controller/bus π’ anunsigned int, and it's literally the number id for this controller/bus, iykyk.serdevβ pointer to slave device for this controller π astruct serdev_device *, the slave device hanging off this controller.opsβ controller operations π― aconst 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 π:
struct serdev_device_ops(9)struct serdev_device(9)struct serdev_device_driver(9)serdev_device_put(9)serdev_controller_put(9)serdev_device_driver_unregister(9)
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
- 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