clk_get(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– clk_get β€” the Kernel API Manual page, bestie edition πŸŽ€

Okay so this is the clk_get(9) page from the Kernel API Manual, and honestly? It's a little icon and you're about to understand it perfectly, no cap.


✨ NAME ✨

clk_get β€” lookup and obtain a reference to a clock producer. literally just "go find me a clock and gimme a reference to it" πŸ’…


🌸 SYNOPSIS 🌸

struct clk * clk_get (struct device *dev , const char *id );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” the device that's acting as the clock "consumer". like, the one doing the consuming. main character energy fr.
  • id β€” the clock consumer ID. this is the name tag your consumer is wearing πŸŽ€

πŸ”₯ DESCRIPTION πŸ”₯

So clk_get returns a struct clk that corresponds to the clock producer, or a valid IS_ERR condition containing errno. yes, that second one matters β€” check it, bestie, don't just vibe with an error pointer 😭

The way the implementation works: it uses dev and id together to determine the clock consumer, and therefore the clock producer. (IOW β€” id may be identical strings, but clk_get may return different clock producers depending on dev.) so like, same nickname, different person, depending on who's asking. iykyk 🌈

🚨 Drivers must assume that the clock source is not enabled. do not assume it's clocked in and ready, because it is not. periodt.
πŸ’€ clk_get should not be called from within interrupt context. just don't. that's the rule.

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/clk.h and every single one of these icons, all listed exactly, because we do not skip the boring parts in this house 🫢


okay that's the whole page, you ate that πŸ’– stay hydrated, check your IS_ERR, and remember: this came from ./include/linux inside the Kernel API Manual, dated October 2026 β€” mwah, bye bestie! πŸ§šπŸ’œ

πŸ“¦ where this page comes from