clk_register(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… clk_register β€” a Kernel API Manual moment (section 9, bestie)

okay so real talk, this one's from the Kernel API Manual, and it's the page for clk_register. She's a little vintage, a little deprecated, but she still serves ✨


πŸŽ€ NAME πŸŽ€

clk_register β€” allocate a new clock, register it, and hand you back an opaque cookie πŸͺ (yes, literally what it says, no cap)


✨ SYNOPSIS ✨

struct clk * clk_register (struct device *dev , struct clk_hw *hw );

that's the whole vibe: two args, one struct clk * coming back at you 🫢


🌸 ARGUMENTS 🌸

  • dev β€” the device that's registering this clock, iykyk. it's the one claiming the clock as its own.
  • hw β€” the link to your hardware-specific clock data. like, the actual tea about how the clock works πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so listen. clk_register is the deprecated interface for populating the clock tree with new clock nodes. like, it still works, it's still here, but it's giving "we don't do that anymore."

use clk_hw_register instead. periodt. that's the glow-up πŸ’…

⚠️ deprecated alert!! not me telling you twice β€” the manpage says deprecated in italics with asterisks around it, so you KNOW it's serious 😭

⭐ RETURN ⭐

on success (slay), you get back a pointer to the newly allocated struct clk β€” but here's the catch, bestie: driver code cannot dereference it. nope. not allowed. instead you use it in conjunction with the rest of the clock API. it's like a claim ticket 🎟️, not the luggage itself.

in the event of an error, clk_register will return an error code. and drivers must test for an error code after calling clk_register β€” like, do not skip the vibe check, fr fr. πŸ”₯


🌈 SEE ALSO 🌈

the whole group chat, in order, no one left out πŸ‘‘


🧚 sign-off 🧚

this page lives in ./drivers/clk, it's dated October 2026, and it's forever filed under clk_register(9). she ate and left no crumbs πŸ’œπŸ’–πŸŽ€

πŸ“¦ where this page comes from