genpd_get_from_provider(9)
π genpd_get_from_provider(9) β the Kernel API Manual, bestie edition
okay so this is a page from the Kernel API Manual, and honestly? It's a little one but it's a cutie. Let's get into it π
β¨ NAME β¨
genpd_get_from_provider β the "hey bestie, where's my PM domain?" look-up function π΅οΈββοΈ
πΈ SYNOPSIS πΈ
struct generic_pm_domain * genpd_get_from_provider (const struct
of_phandle_args *genpdspec );
Like, that's the whole signature. She's compact. She's iconic. She takes exactly one argument and hands you back a PM domain pointer or an error. No cap. π
π ARGUMENTS π
genpdspecβ the OF phandle args that we're gonna use for the look-up. That's literally it, that's her whole job. She's the little map you hand over so the function knows where to go hunting π
π¦ DESCRIPTION π¦
So here's the vibe: genpd_get_from_provider goes looking for a PM domain provider under the node that genpdspec specifies. Like, it's knocking on doors in the device tree, asking "any PM domain providers here? hello??" πͺβ¨
And if it does find one β slay β it uses the xlate function of the provider to map those phandle args over to an actual PM domain. That's the whole translation arc, it's giving matchmaker energy fr fr π
Then the return value:
- On success, you get a valid pointer to
struct generic_pm_domainβ iconic, flawless, exactly what you wanted π - On failure, you get an
ERR_PTRβ which means check it withIS_ERR(), bestie, do not just dereference it and hope for the best ππ
no cap: this function does NOT returnNULLon failure, it returnsERR_PTR. They are not the same thing and mixing them up is a whole situation. π
π§ SEE ALSO π§
The kernel file this lives in:
./drivers/pmdomain/core.c
And now the (very long, extremely well-connected) friend group π:
dev_pm_genpd_set_performance_state(9)dev_pm_genpd_set_next_wakeup(9)dev_pm_genpd_get_next_hrtimer(9)dev_pm_genpd_set_hwmode(9)dev_pm_genpd_get_hwmode(9)dev_pm_genpd_rpm_always_on(9)dev_pm_genpd_is_on(9)pm_genpd_inc_rejected(9)genpd_queue_power_off_work(9)genpd_power_off(9)genpd_power_on(9)genpd_power_off_work_fn(9)__genpd_runtime_suspend(9)__genpd_runtime_resume(9)genpd_runtime_suspend(9)genpd_runtime_resume(9)genpd_power_off_unused(9)genpd_sync_power_off(9)genpd_sync_power_on(9)genpd_prepare(9)genpd_finish_suspend(9)genpd_suspend_noirq(9)genpd_finish_resume(9)genpd_resume_noirq(9)genpd_freeze_noirq(9)genpd_thaw_noirq(9)genpd_poweroff_noirq(9)genpd_restore_noirq(9)genpd_complete(9)dev_pm_genpd_suspend(9)dev_pm_genpd_resume(9)pm_genpd_add_device(9)pm_genpd_remove_device(9)dev_pm_genpd_add_notifier(9)dev_pm_genpd_remove_notifier(9)pm_genpd_add_subdomain(9)pm_genpd_remove_subdomain(9)pm_genpd_init(9)pm_genpd_remove(9)struct of_genpd_provider(9)genpd_xlate_simple(9)genpd_xlate_onecell(9)genpd_add_provider(9)of_genpd_add_provider_simple(9)of_genpd_add_provider_onecell(9)of_genpd_del_provider(9)of_genpd_add_child_ids(9)of_genpd_remove_child_ids(9)of_genpd_add_device(9)of_genpd_add_subdomain(9)of_genpd_remove_subdomain(9)of_genpd_remove_last(9)genpd_dev_pm_detach(9)genpd_dev_pm_attach(9)genpd_dev_pm_attach_by_id(9)genpd_dev_pm_attach_by_name(9)of_genpd_parse_idle_states(9)of_genpd_sync_state(9)
like, she knows everyone. main character energy fr π«Ά
π the sign-off π
This one lives in ./drivers/pmdomain, dated October 2026, and it's part of the Kernel API Manual. That's the whole footer, bestie β go read the whole genpd friend group now, it's a rabbit hole and it's lowkey addictive πβπ
π¦ 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