of_clk_detect_critical(9)
π of_clk_detect_critical(9) π
okay so bestie, we're in the Kernel API Manual and this one is a function. Yes, a function, not a command β it's of_clk_detect_critical(9), and honestly? It's giving "legendary relic that should stay in the museum." Let's get into it π
β¨ NAME β¨
of_clk_detect_critical β set CLK_IS_CRITICAL flag from Device Tree. that's the whole vibe.
πΈ SYNOPSIS πΈ
int of_clk_detect_critical (struct device_node *np , int index ,
unsigned long *flags );
like, that's the signature, copy it exactly, don't be weird about it π«Ά
π¦ ARGUMENTS π¦
npβ Device node pointer associated with clock provider. yeah. the node. the device tree one. you know the one πindexβ clock index. just the index, bestie, that's it.flagsβ pointer to top-level framework flags. a pointer, so be normal about it β¨
π DESCRIPTION π
so what does it actually do? It detects if the clock-critical property exists and, if so, sets the corresponding CLK_IS_CRITICAL flag. that's the whole bit. icon behavior, lowkey π
Now the part you need to hear, and I'm gonna say it with my whole chest:
Do not use this function. π¨
Not me being dramatic β that's literally the instruction. It exists only for legacy Device Tree bindings, such as the one-clock-per-node style that are outdated. Those bindings typically put all clock data into .dts and the Linux driver has no clock data, thus making it impossible to set this flag correctly from the driver. so like, the driver literally can't do it right, that's the whole problem π
Only those drivers may call of_clk_detect_critical from their setup functions. only them. nobody else. iykyk π§
β RETURN β
error code or zero on success. that's it. zero means slay, anything else means go read the error code π
π SEE ALSO π
okay this list is long long, but we do not skip. every single one, in order, periodt. also heads up β there's a Kernel file in here too: ./drivers/clk/clk.c π₯
struct clk_core(9)clk_pm_runtime_get_all(9)clk_pm_runtime_put_all(9)clk_core_get(9)clk_determine_rate_noop(9)clk_rate_exclusive_put(9)clk_rate_exclusive_get(9)clk_unprepare(9)clk_prepare(9)clk_disable(9)clk_gate_restore_context(9)clk_save_context(9)clk_restore_context(9)clk_enable(9)clk_is_enabled_when_prepared(9)clk_hw_init_rate_request(9)clk_hw_forward_rate_request(9)__clk_determine_rate(9)clk_hw_round_rate(9)clk_round_rate(9)__clk_notify(9)__clk_recalc_accuracies(9)clk_get_accuracy(9)__clk_recalc_rates(9)clk_get_rate(9)clk_hw_get_parent_index(9)__clk_speculate_rates(9)clk_set_rate(9)clk_set_rate_exclusive(9)clk_set_rate_range(9)clk_set_min_rate(9)clk_set_max_rate(9)clk_get_parent(9)clk_has_parent(9)clk_set_parent(9)clk_set_phase(9)clk_get_phase(9)clk_set_duty_cycle(9)clk_get_scaled_duty_cycle(9)clk_is_match(9)clk_debug_register(9)clk_debug_init(9)__clk_core_init(9)clk_core_link_consumer(9)clk_core_unlink_consumer(9)alloc_clk(9)free_clk(9)clk_hw_create_clk(9)clk_hw_get_clk(9)dev_or_parent_of_node(9)clk_register(9)clk_hw_register(9)clk_unregister(9)clk_hw_unregister(9)devm_clk_register(9)devm_clk_hw_register(9)devm_clk_hw_get_clk(9)clk_notifier_register(9)clk_notifier_unregister(9)struct of_clk_provider(9)of_clk_add_provider(9)of_clk_add_hw_provider(9)devm_of_clk_add_hw_provider(9)of_clk_del_provider(9)of_parse_clkspec(9)of_clk_get_from_provider(9)of_clk_get_by_name(9)of_clk_get_parent_count(9)of_clk_parent_fill(9)of_clk_init(9)
like. seventy of them. we did it. ate and left no crumbs π
and that's the page, bestie!! this lil doc lives in ./drivers/clk, dated October 2026, and yeah β same title, same manual, no cap πβ¨ππ¦
π¦ 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