dev_pm_domain_detach(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… dev_pm_domain_detach β€” the kernel API manual, bestie edition ✨

okay so you found dev_pm_domain_detach, the little function in the kernel API manual that's literally the "we're breaking up" text to a device's PM domain. sit down, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

dev_pm_domain_detach β€” Detach a device from its PM domain. that's it, that's the whole vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

void dev_pm_domain_detach (struct device *dev , bool power_off );

returns nothing (void, she gives nothing and expects nothing back πŸ’…), and it takes a device plus a bool. iconic signature tbh.


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” Device to detach. the main character of this whole operation πŸ‘‘
  • power_off β€” Used to indicate whether we should power off the device. yes bestie, it's a flag, and it does exactly what it says on the tin ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

so this function will reverse the actions from dev_pm_domain_attach, dev_pm_domain_attach_by_id and dev_pm_domain_attach_by_name, thus it detaches dev from its PM domain. it's giving "undo button but make it power management" 😭

typically it should be invoked during the remove phase, either from subsystem level code or from drivers. so like, cleanup era. the farewell tour. 🌈

⚠️ ok real talk for a sec, bestie β€” callers must ensure proper synchronization of this function with power management callbacks. no cap, don't be sloppy about this one, fr fr.

πŸ’œ SEE ALSO πŸ’œ

like, read the whole friend group, they all ate honestly 🫢


and that's the page! 🧚 this one's from the ./drivers/base/power corner of the kernel, dated October 2026, living under the Kernel API Manual umbrella. stay synced, stay detached, mwah πŸ’–πŸ”₯

πŸ“¦ where this page comes from