STRUCT FAUX_DEVICE_OPS(9)
β¨ struct faux_device_ops(9) β¨
okay bestie, welcome to the Kernel API Manual π this one's a tiny little struct from <pink>struct faux_device_ops(9)</pink> land and honestly? it's giving "small but mighty." let's get into it π«Ά
πΈ NAME πΈ
struct faux_device_ops β literally just a set of callbacks for a struct faux_device π
that's it, that's the whole gig
π SYNOPSIS π
struct faux_device_ops {
int (*probe)(struct faux_device *faux_dev);
void (*remove)(struct faux_device *faux_dev);
};
look at her. two little function pointers. iconic behavior, no notes π₯
π¦ Members π¦
probeβ this one gets called when a faux device is probed by the driver core, and the timing matters, bestie: it happens before the device is fully bound to the internal faux bus code. so if your probe slays, return0. if it does not slay, return a negative error number to stop the probe sequence from succeeding. no pressure or anything πremoveβ called when a faux device is removed from the system. that's the whole vibe check. bye bestie π
π Description π
okay so here's the tea: both probe and remove are optional. like, genuinely optional, not fake-optional. if you don't need one of them, just set it to NULL and keep it moving π
fr fr, NULL is a valid choice here. don't overthink it. π
π SEE ALSO π
- Kernel file
./include/linux/device/faux.h struct faux_device(9)
aaaand that's the page, bestie β¨ go forth and write your callbacks π§π
sign-off time: this little masterpiece lives in ./include/linux/device, dated October 2026, and it's filed under struct faux_device_ops(9) β mwah π
π
π¦ 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