omap_hwmod_f...ach_by_class(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… omap_hwmod_for_each_by_class β€” a Kernel API Manual moment

okay so bestie, you know how the kernel manual pages are out here looking like a wall of sad plaintext? yeah. not on my watch. this one lives in the Kernel API Manual and it's genuinely so useful once you get past the vibes πŸ’–


✨ NAME ✨

omap_hwmod_for_each_by_class β€” no cap, this one literally calls @fn for each hwmod of class @classname πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

int omap_hwmod_for_each_by_class (const char *classname , int
       (*fn)(struct omap_hwmod *oh, void *user) , void *user );

like… she's a function signature, she's iconic, she takes three things. we move πŸ’…


🌸 ARGUMENTS 🌸

  • classname β€” the struct omap_hwmod_class name you're hunting for. this is your search key, your main character filter πŸ”
  • fn β€” callback function pointer to call for each hwmod in class classname. yes bestie, you bring the function, she brings the hwmods 🫢
  • user β€” arbitrary context data to pass to the callback function. literally whatever you want, she's not nosy πŸ™ˆ

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea: for each omap_hwmod of class classname, call fn. that's it. that's the whole vibe ✨

BUT β€” and this is the important part, so pay attention β€” if the callback function returns something other than zero, the iterator is terminated 😭 and the callback function's return value is passed back to the caller. so your function can slam the brakes on the whole loop whenever it wants. lowkey powerful.

Returns 0 upon success, -EINVAL if classname or fn are NULL (pls don't do that), or passes back the error code from fn. periodt πŸ’€

bestie reminder: -EINVAL when classname or fn are NULL β€” that's your vibe check failing, not a bug okurrr

🌈 SEE ALSO 🌈

okay this list is LONG, she ate and left no crumbs, so let's get into it πŸ‘‘

iykyk, that's the whole squad πŸ’œ


and that's the page bestie 🫢 sign-off time: this lil masterpiece comes from ./arch/arm/mach-omap2, and it's dated October 2026. go forth and iterate, you absolute icon πŸ‘‘βœ¨

πŸ“¦ where this page comes from