dev_pm_get_subsys_data(9)
β¨ 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:
dev_pm_put_subsys_data(9)dev_pm_domain_attach(9)dev_pm_domain_attach_by_id(9)dev_pm_domain_attach_by_name(9)dev_pm_domain_attach_list(9)devm_pm_domain_detach_list(9)devm_pm_domain_attach_list(9)dev_pm_domain_detach(9)dev_pm_domain_detach_list(9)dev_pm_domain_start(9)dev_pm_domain_set(9)dev_pm_domain_set_performance_state(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms