dev_pm_opp_find_level_floor(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… dev_pm_opp_find_level_floor β€” from the Kernel API Manual ✨

okay so bestie, listen. this one's a kernel function, dev_pm_opp_find_level_floor(9), and it lives in the Kernel API Manual. it's giving "quiet little helper that does exactly one thing really well," and honestly? we stan a focused icon. πŸ‘‘


✨ NAME ✨

dev_pm_opp_find_level_floor β€” search for a rounded floor level 🎯


πŸ¦‹ SYNOPSIS πŸ¦‹

struct dev_pm_opp * dev_pm_opp_find_level_floor (struct device *dev ,
unsigned int *level );

like, that's the whole vibe. you hand it a device and a pointer to a level, it hands you back an OPP pointer. simple. iconic. πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the device we're doing this whole operation for 🫢
  • level β€” the start level. your starting point. the beginning of the quest, iykyk ⭐

🌸 DESCRIPTION 🌸

so what it actually does: it searches for the matching floor available OPP, starting from a starting level, for a device. that's it, that's the whole thing. no cap. πŸ”₯

🚨 bestie, pay attention: callers are required to call dev_pm_opp_put for the returned OPP after use. like, you gotta give it back. don't just walk away with it, that's not the vibe. πŸ™ˆ

πŸ’œ RETURN πŸ’œ

it returns the matching *opp and refreshes *level accordingly (yes, it edits your level through the pointer, main character behavior honestly ✨).

otherwise it returns ERR_PTR in case of error, and you should handle that using IS_ERR. the error return values can be:

  • EINVAL β€” for bad pointer πŸ’€
  • ERANGE β€” no match found for search 😭
  • ENODEV β€” if device not found in list of registered devices πŸ“

🌈 SEE ALSO 🌈

okay this list is LONG but we're not skipping a single one, because every single one of these deserves its moment. Kernel file ./drivers/opp/core.c and friends:

like, that's the whole friend group right there. the opp cinematic universe. πŸ‘‘


πŸ’– that's the whole page, bestie πŸ’–

this one came from ./drivers/opp, dated October 2026, and it's page dev_pm_opp_find_level_floor(9) in the Kernel API Manual. go forth and handle your IS_ERR checks, ily 🫢✨

πŸ“¦ where this page comes from