dev_pm_get_subsys_data(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ dev_pm_get_subsys_data(9) ✨

okay bestie, buckle up, we're in the Kernel API Manual today and this one is a little refcount baddie πŸ’…


πŸŽ€ NAME πŸŽ€

dev_pm_get_subsys_data β€” creates the power.subsys_data for a device, or refcounts it if it's already there. literally that's her whole job 🫢


🌸 SYNOPSIS 🌸

int dev_pm_get_subsys_data (struct device *dev );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” the device you're handling. the main character of this function, no cap πŸ’–

✨ DESCRIPTION ✨

so here's the vibe check πŸ‘‘

If power.subsys_data is NULL, this function points it at a brand new object. If it's not NULL, it just bumps that object's reference counter instead. either way she's making sure the thing exists and stays alive 🧚

Return value tea β˜•:

  • 0 β€” slay, it worked. either a new object got created or the refcount got increased.
  • negative error code β€” not slay 😭 something went wrong.
ngl if you see a negative number come back, that's your sign to go handle it. don't just ignore it, bestie πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/base/power/common.c + the whole friend group:


and that's the whole page, bestie πŸŽ€ this one lives under ./drivers/base/power and it's dated October 2026, filed under dev_pm_get_subsys_data(9) β€” go forth and refcount responsibly, ily πŸŒˆπŸ’œ

πŸ“¦ where this page comes from