enclosure_add_device(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME

Okay so bestie, welcome to enclosure_add_device(9) β€” the Kernel API Manual page that’s literally about adding a device as being part of an enclosure. Slay. 🫢


✨ SYNOPSIS

int enclosure_add_device (struct enclosure_device *edev , int component
       , struct device *dev );

πŸŽ€ ARGUMENTS

  • edev β€” the enclosure device being added to. It’s giving β€œthe enclosure in question” energy.
  • component β€” the number of the component. Yes, the actual number. No cap.
  • dev β€” the device being added. The main character device itself. πŸ‘‘

πŸ¦‹ DESCRIPTION

So this function declares a real device to reside in slot (or identifier) num of an enclosure. The way that works is it causes the relevant sysfs links to appear. ✨

It may also be used to change a device associated with an enclosure without having to call enclosure_remove_device in between. Convenient? Lowkey iconic. πŸ’…

Returns zero on success or an error. That’s the vibe check: 0 means we ate, anything else means something went off. 😭


πŸ‘‘ SEE ALSO

Kernel file ./drivers/misc/enclosure.c plus the whole friend group:


Signed, sealed, and delivered from the ./drivers/misc source, dated October 2026, filed under enclosure_add_device(9) β€” mwah πŸ’‹πŸ’…

πŸ“¦ where this page comes from