pwrdm_for_each(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pwrdm_for_each β€” the "do a thing to literally every powerdomain" iterator ✨

okay bestie, so this one is a Kernel API Manual classic, and honestly it's giving "tiny function, big main character energy." Let's get into it πŸŽ€


🌸 NAME 🌸

pwrdm_for_each β€” call function on each registered clockdomain

(yes, the official one-liner says clockdomain, and I'm quoting it exactly β€” don't come for me, I just work here πŸ’œ)


✨ SYNOPSIS ✨

int pwrdm_for_each (int (*fn)(struct powerdomain *pwrdm, void *user) ,
void *user );

🫢 ARGUMENTS 🫢

  • fn β€” the callback function * (that's what the page says, asterisk and all β€” iconic, no notes πŸ’…)
  • user β€” -- undescribed -- 😭 that's genuinely all the original gives us, so that's all I'm giving you. We respect the mystery.

πŸ”₯ DESCRIPTION πŸ”₯

So here's the vibe: you hand over a function fn, and it gets called for each registered powerdomain. Every single one. Like a group chat roll call but for powerdomains, no cap.

Now this is the important bit, so listen up πŸ‘‘ β€” the callback function fn can return anything, but if it returns anything that isn't 0, it bails out early from the iterator. That's your escape hatch, your "ok I'm done here" moment. πŸ¦‹

And what does pwrdm_for_each itself return? The last return value of the callback function. That value should be 0 for success, or literally anything else to indicate failure. ✨

Oh and 🚨 β€” if the function pointer is null, you get -EINVAL. That's it, that's the whole deal.

ngl this is a small function but the contract matters fr fr: 0 = slay, non-zero = bail immediately, null pointer = -EINVAL πŸ’€

πŸ’– SEE ALSO πŸ’–

group-chat roll call of related pages, all from the kernel file ./arch/arm/mach-omap2/powerdomain.c:


and that's the whole page, bestie 🌈 this little gem comes to you from ./arch/arm/mach-omap2, dated October 2026, out of the Kernel API Manual (that's the pwrdm_for_each(9) section name right there πŸŽ€). go iterate over some powerdomains and stay hydrated πŸ’œπŸ¦‹βœ¨

πŸ“¦ where this page comes from