dev_pm_opp_find_freq_ceil(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– dev_pm_opp_find_freq_ceil β€” Kernel API Manual ✨

okay so bestie, welcome to the group chat about dev_pm_opp_find_freq_ceil(9), which lives in the Kernel API Manual and is genuinely one of those lil functions that's lowkey iconic once you get it πŸŽ€


🌸 NAME 🌸

dev_pm_opp_find_freq_ceil β€” search for a rounded ceil freq

like, it's giving "find me the next frequency up from here" energy, and honestly? we love that for us πŸ’…


✨ SYNOPSIS ✨

struct dev_pm_opp * dev_pm_opp_find_freq_ceil (struct device *dev ,
unsigned long *freq );

no cap, that's the whole vibe right there β€” you hand it a device and a pointer to a frequency, it goes looking πŸ¦‹


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the device we're doing this whole operation for. main character device energy, fr fr πŸ‘‘
  • freq β€” the start frequency. this is where the search kicks off πŸ’«

πŸ’œ DESCRIPTION πŸ’œ

so basically, it searches for the matching ceil available OPP, starting from a given freq, for a device. the "ceil" is doing a lot of work here β€” we're rounding up, bestie, not down πŸ“ˆ

ok important psa: the callers are required to call dev_pm_opp_put for the returned OPP after use. do NOT forget this. it's literally the number one thing. put it back. put it back bestie πŸ˜­πŸ’€

🌈 RETURN 🌈

it gives you the matching *opp and refreshes *freq accordingly ✨ β€” but if something goes sideways it returns ERR_PTR instead, in case of error, and you should handle that using IS_ERR. no skipping the vibe check on that one 🫢

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 🧚

kernel file ./drivers/opp/core.c and honestly the whole friend group:


and that's the whole page, bestie β€” go forth and ceil responsibly πŸ’–βœ¨

sign-off time 🫢 this lil manpage comes from ./drivers/opp, dated October 2026, and it's the dev_pm_opp_find_freq_ceil(9) page in the Kernel API Manual. ily, drink water, and don't forget dev_pm_opp_put πŸ“πŸ§šβ€β™€οΈπŸ’œ

πŸ“¦ where this page comes from