devm_clk_get_prepared(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– devm_clk_get_prepared(9) β€” the Kernel API Manual, but make it make sense ✨

okay so bestie, you're reading the devm_clk_get_prepared(9) page from the Kernel API Manual and honestly? it's a little baddie. it's literally devm_clk_get() plus clk_prepare() and nothing else, no cap πŸŽ€


🌸 NAME 🌸

devm_clk_get_prepared β€” it's giving devm_clk_get() + clk_prepare(), together, iconic behavior πŸ’…


✨ SYNOPSIS ✨

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

that's it, that's the whole signature, slay 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” the device that's acting as the clock "consumer". yes, the clock is being consumed, we stan a hungry device πŸ“
  • id β€” the clock consumer ID. like the clock's little name tag at the party πŸŽ€

πŸ’œ CONTEXT πŸ’œ

May sleep. MAY SLEEP. not me warning you that this one cannot be called from an atomic context β€” she needs her beauty rest πŸ˜­πŸ’€


🌈 RETURN 🌈

you get back a struct clk that corresponds to the clock producer β€” or a valid IS_ERR condition containing errno if things went sideways πŸ™ˆ

the implementation uses dev and id to figure out the clock consumer, and through that, the clock producer. and this is the part that gets people every time, so listen up:

IOW, id may be identical strings, but clk_get may return different clock producers depending on dev.

read that again, fr fr. same string, different device, different producer. it's giving "same outfit, different main character" πŸ‘‘


🧚 DESCRIPTION 🧚

the returned clk (if it's valid) is prepared. but drivers must however assume that the clock is not enabled β€” prepared β‰  enabled, bestie, those are two completely different vibes, don't conflate them ⭐

and here's the free real estate: the clock will automatically be unprepared and freed when the device is unbound from the bus. devm said "I gotchu, go live your life" πŸ’–


πŸ”₯ SEE ALSO πŸ”₯

the whole friend group, in order, no one left out πŸ’…


okay that's the whole page, you ate that 🫢✨

this lil baddie lives over in ./include/linux and the manual's dated October 2026 β€” so like, future vibes only πŸ’œ see you in the next man page, mwah πŸ˜˜πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from