DEVICE_DETACH(9)
β¨ DEVICE_DETACH(9) β¨
okay so bestie, this one is from the Kernel Developer's Manual and it's lowkey the breakup manual for devices π the way that drivers and hardware can just... part ways. iconic.
πΈ NAME πΈ
DEVICE_DETACH β detach a device
π SYNOPSIS π
#include <sys/param.h>
#include <sys/bus.h>
int
DEVICE_DETACH(device_t dev);
π DESCRIPTION π
So you're detaching a device. Main character move honestly. This can be called if the user is replacing the driver software, or if a device is about to be physically removed from the system π«Ά no cap, those are the two situations.
The method should deallocate any system resources allocated during the DEVICE_ATTACH(9) method, and reset the hardware to a sane state (i.e., disable interrupts etc.) β¨ like, clean up after yourself, don't just leave your stuff everywhere. be a decent ex, yk?
tl;dr β whatever you allocated in attach, you free here. and put the hardware back in a sane state (interrupts off, etc.).
π RETURN VALUES π
Zero is returned on success, otherwise an appropriate error is returned. fr fr, zero means slay π anything else means something went sideways.
π¦ SEE ALSO π¦
π AUTHORS π
This manual page was written by Doug Rabson. giving credit where credit is due π«Ά
π that's the whole page bestie, go detach something responsibly π
this one's from the Debian build of the manpage, dated June 16, 1998 β yes, a literal 90s icon πβ¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 1998 Doug Rabson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms