dev_pm_opp_find_level_exact(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… dev_pm_opp_find_level_exact(9) β€” Kernel API Manual ✨

okay bestie, buckle up, because this one is from the Kernel API Manual and it's lowkey a little legend. it's called dev_pm_opp_find_level_exact and the whole vibe is: you want one specific level, you get one specific level, no games πŸ’…


🌸 NAME 🌸

dev_pm_opp_find_level_exact β€” search for an exact level 🎯


✨ SYNOPSIS ✨

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

that's the whole signature, no cap. two args, one pointer back 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the device we're doing this whole operation for. like, whose opp table are we snooping in πŸ‘€
  • level β€” the level you're searching for. exactly this one. not "close enough", not "something in the ballpark", this level 🎯

πŸ¦‹ RETURN πŸ¦‹

so it searches for an exact match in the opp table and hands you back a pointer to the matching opp if it found one. if it didn't, it returns ERR_PTR on error, and bestie you must handle that with IS_ERR. no ignoring it, fr fr 😭

the possible error return values are:

  • EINVAL β€” bad pointer πŸ™ˆ
  • ERANGE β€” no match found for your search πŸ’€
  • ENODEV β€” the device wasn't found in the list of registered devices 🫠
no match found is literally an error here. exact means exact, she does not compromise ✨

🌈 DESCRIPTION 🌈

the callers are required to call dev_pm_opp_put for the returned OPP after use. yes, after use. it's giving "you borrowed my hoodie, give it back" energy πŸ§₯🫢 don't leave it hanging, that's how you get leaks and nobody wants that.


πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./drivers/opp/core.c, plus the whole opp bestie squad:


✨ reminder from your girl: exact match or nothing, handle your ERR_PTR with IS_ERR, and always dev_pm_opp_put when you're done. that's the vibe check and you passed πŸ’–

mwah, that's a wrap πŸŽ€ this little gem lives in ./drivers/opp, dated October 2026, and it's page dev_pm_opp_find_level_exact(9) β€” go forth and search exactly, bestie πŸ¦‹

πŸ“¦ where this page comes from