DEVICE_DELETE_CHILD(9)
π DEVICE_DELETE_CHILD π
okay so bestie, welcome to device_delete_child(9) β it's a kernel developer's manual page, and honestly? it's giving "small function, big responsibilities." let me put you on π«Ά
β¨ NAME β¨
device_delete_child β delete a child from a device. yes, literally that. the child gets deleted. gone. no cap. π
π SYNOPSIS π
here's the exact vibe, copy it character for character:
#include <sys/param.h>
#include <sys/bus.h>
int
device_delete_child(device_t dev, device_t child);
πΈ DESCRIPTION πΈ
so the specified device gets removed from dev and then deleted. periodt. β¨
but wait β if the device is currently attached, it's first detached via device_detach(9). and if device_detach() fails, its error value is returned. like, the function is not gonna pretend everything's fine, it's gonna hand you back that error and let you deal with it. real main character energy, honestly. π₯
otherwise (and this is the slay part), all descendant devices of child are deleted and zero is returned. the whole little family tree gets cleaned up and you get a 0 back. π§
also! the BUS_CHILD_DELETED(9) method is invoked for each device that is deleted. this permits the parent device's driver to tear down any state associated with child devices such as ivars. like it's the parent driver's moment to clean up its own business before everything's gone. respectful. iconic. π
π RETURN VALUES π
zero is returned on success, otherwise an error is returned. simple, cute, no surprises. π
π¦ SEE ALSO π¦
π AUTHORS π
this manual page was written by Doug Rabson. thank you Doug, king behavior, we see you. π
ngl bestie, if you're deleting devices you're already doing some serious kernel work β take a vibe check before you ship it, and read the SEE ALSO entries. they're there for a reason. π
this page was brought to you by the Debian crew, dated February 5, 2025 β DEVICE_DELETE_CHILD(9) in the Kernel Developer's Manual. mwah, bye! π
β¨
π¦ 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