dev_pm_opp_find_level_ceil(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… dev_pm_opp_find_level_ceil (9) β€” from the Kernel API Manual, bestie ✨

okay so this is dev_pm_opp_find_level_ceil(9) and I'm literally obsessed because it does exactly one thing and does it gorgeously: it finds you a level, but it rounds up. no cap. πŸŽ€


🌸 NAME 🌸

dev_pm_opp_find_level_ceil β€” search for an rounded up level πŸ’–

✨ SYNOPSIS ✨

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

that's the whole vibe. two args, one pointer back at you. simple, iconic, no drama. πŸ¦‹

🫢 ARGUMENTS 🫢

  • dev β€” the device we're doing this whole operation for. main character energy, honestly. πŸ‘‘
  • level β€” the level you're searching for. like, this is your starting point, bestie.

πŸ”₯ RETURN πŸ”₯

so here's what happens: it searches for a rounded up match in the opp table, and if it finds one it hands you back a pointer to that matching opp. slay. πŸ’…

but if something goes wrong? it returns ERR_PTR instead, and you gotta handle that with IS_ERR β€” this is not a suggestion, it's the rules. πŸ™ˆ

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 😬

🧚 DESCRIPTION 🧚

the callers are required to call dev_pm_opp_put for the returned OPP after use. like, no seriously. you took it out, you put it back. that's the whole deal. periodt. ⭐

🌈 SEE ALSO 🌈

kernel file ./drivers/opp/core.c, plus literally the entire extended family of these functions, all of them, in order, don't skip a single one πŸ’œ:


bestie quick vibe check: ERR_PTR is real, IS_ERR is not optional, and dev_pm_opp_put is your cleanup era. don't fumble it. 🫢

okay and finally, the cute little sign-off: this one lives in ./drivers/opp, it's dated October 2026, and it's filed under dev_pm_opp_find_level_ceil(9). mwah. πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from