devm_pm_opp_of_add_table(9)
π devm_pm_opp_of_add_table π
okay bestie, welcome to the Kernel API Manual β this one's all about booting up your OPP table straight from the device tree, and it's honestly kind of iconic. it's devm_pm_opp_of_add_table, and yes the devm_ prefix is doing exactly what you think it's doing (auto-cleanup, we love a self-cleaning king π).
β¨ NAME β¨
devm_pm_opp_of_add_table β initialize opp table from device tree
π¦ SYNOPSIS π¦
int devm_pm_opp_of_add_table (struct device *dev );
π ARGUMENTS π
devβ device pointer used to lookup OPP table. that's it, that's the whole arg bestie π
πΈ DESCRIPTION πΈ
so basically this registers the initial OPP table with the OPP library for whatever device you handed it. that's the vibe check β
and here's the lowkey best part: the opp_table structure will be freed after the device is destroyed. no cap, the devm machinery handles the cleanup for you so you don't have to think about it β main character energy fr fr π«Ά
π₯ RETURN π₯
here's where it gets real, so pay attention:
0β on success OR duplicate OPPs (both freq and volt are same) andopp->available-EEXISTβ freq are same and volt are different OR duplicate OPPs (both freq and volt are same) and!opp->available-ENOMEMβ memory allocation failure π-ENODEVβ when'operating-points'property is not found or is invalid data in device node-ENODATAβ when empty'operating-points'property is found-EINVALβ when invalid entries are found in opp-v2 table
ngl the 0 case being "success OR duplicate OPPs" is a whole mood β it's giving "if it's already there, we're fine, moving on" π
π§ SEE ALSO π§
kernel file ./drivers/opp/of.c, plus these legends:
dev_pm_opp_of_remove_table(9)_opp_add_static_v2(9)dev_pm_opp_of_add_table(9)dev_pm_opp_of_add_table_indexed(9)devm_pm_opp_of_add_table_indexed(9)dev_pm_opp_of_cpumask_remove_table(9)dev_pm_opp_of_cpumask_add_table(9)dev_pm_opp_of_get_sharing_cpus(9)of_get_required_opp_performance_state(9)dev_pm_opp_of_has_required_opp(9)dev_pm_opp_get_of_node(9)dev_pm_opp_calc_power(9)dev_pm_opp_of_register_em(9)
and that's the whole page, bestie!! go forth and register those OPP tables πβ¨
this has been brought to you by ./drivers/opp, dated October 2026, from the Kernel API Manual β stay slay, stay devm'd ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms