genpd_get_from_provider(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 with IS_ERR(), bestie, do not just dereference it and hope for the best πŸ˜­πŸ’€
no cap: this function does NOT return NULL on failure, it returns ERR_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 πŸ’œ:

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