of_clk_get_by_name(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ of_clk_get_by_name(9) πŸ¦‹

okay bestie, welcome to the Kernel API Manual entry for of_clk_get_by_name(9) πŸ’… this is the function you call when your device tree node is like "hey, i need my clock" and you're like "say less, let me go find it" ✨


🌸 NAME 🌸

of_clk_get_by_name β€” parse and lookup a clock referenced by a device node πŸŽ€


✨ SYNOPSIS ✨

struct clk * of_clk_get_by_name (struct device_node *np , const char *name );

πŸ’– ARGUMENTS πŸ’–

  • np β€” pointer to clock consumer node 🌈 like, the device tree node that's consuming the clock, not the one providing it, iykyk
  • name β€” name of consumer's clock input, or NULL for the first clock reference πŸ‘‘ so if you're too lazy to name it, pass NULL and you get the first one, no cap

🧚 DESCRIPTION 🧚

okay so here's the vibe: this function parses the clocks and clock-names properties, and uses them to look up the struct clk from the registered list of clock providers 🫢

that's the whole thing. it reads the properties off your node, matches them up against everybody who's registered as a clock provider, and hands you back the struct clk * you've been waiting for. main character energy, honestly ⭐


πŸ”₯ SEE ALSO πŸ”₯

the whole friend group, fr fr β€” go read these next, they're iconic πŸ’œ


πŸŽ€ that's the whole page, bestie! this lil gem lives over in ./drivers/clk and it's stamped October 2026 β€” go forth and get your clocks, you absolute icon πŸ’…πŸ«Άβœ¨

πŸ“¦ where this page comes from