DEVICE_SET_DRIVER(9)
π« DEVICE_SET_DRIVER π«
okay so bestie, welcome to DEVICE_SET_DRIVER(9) from the Kernel Developer's Manual β yes it's giving kernel-dev main character energy and honestly? iconic. let's get into it π«Ά
β¨ NAME β¨
device_set_driver β the little function that goes "hey, this driver? it belongs to this device node in the tree." matching them up like it's prom π
πΈ SYNOPSIS πΈ
#include <sys/param.h>
#include <sys/bus.h>
void
device_set_driver(device_t dev, driver_t *driver);
like, literally copy that in and you're set β¨
π¦ DESCRIPTION π¦
so what does it actually do? device_set_driver() associates a specific driver with a given device node in the tree. that's the whole vibe β you hand it a device_t dev and a driver_t *driver, and boom, they're linked π₯
where you'll see this used fr fr: it's typically used inside DEVICE_IDENTIFY(9) functions, specifically to add devices to a bus that does not support doing so automatically β the ISA bus being the classic example here π
so basically: bus won't do the matching itself? not on your watch. you do it manually and slay π
π SEE ALSO π
device(9)β go read this one too, iykyk
π AUTHORS π
this manual page was written by M. Warner Losh β thank you for your service, king π
and that's the whole page, bestie! short, sweet, and 100% useful π
sign-off time π β this one's straight out of the Debian edition, dated April 21, 2003, and the page is literally named DEVICE_SET_DRIVER(9). periodt.
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 2003 M. Warner Losh <imp@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms