BUS_CHILD_DETACHED(9)

πŸ’– BUS_CHILD_DETACHED πŸ’–

okay bestie, so this is a page from the Kernel Developer's Manual, section 9 β€” yes, that section 9, the one where all the kernel-internals girlies hang out πŸ’…. It's literally called BUS_CHILD_DETACHED and it's here to spill the tea on how a bus device finds out one of its children just left the group chat. πŸ¦‹


✨ NAME ✨

BUS_CHILD_DETACHED β€” notify a bus device that a child was detached


🌸 SYNOPSIS 🌸

#include <sys/param.h>
#include <sys/bus.h>

void
BUS_CHILD_DETACHED(device_t dev, device_t child);

πŸŽ€ DESCRIPTION πŸŽ€

so the BUS_CHILD_DETACHED() method is invoked by the new-bus framework after a device is detached. periodt. ✨

and like, a bus driver can totally provide an implementation of this method if it wants to:

  • reclaim any resources allocated on behalf of the child, or
  • cleanup state that wasn't properly released by a DEVICE_DETACH(9) method

it's giving "the child already moved out, but their stuff is still in your room" energy 😭 β€” this is your moment to go through the closet and deal with it. no cap.

fr fr, if you don't implement this, whatever the child left behind just... stays behind. πŸ‘‘ do with that information what you will.

πŸ‘€ SEE ALSO πŸ‘€


mwah πŸ’œ that's the whole page, you ate it up. this one came from Debian, dated August 21, 2012 β€” iconic vintage behavior honestly πŸŽ€βœ¨

πŸ“¦ where this page comes from