of_clk_detect_critical(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ 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 πŸ”₯

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