clk_hw_get_...nabled_kunit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… clk_hw_get_clk_prepared_enabled_kunit πŸ’…

okay so bestie, this is a page straight out of the Kernel API Manual and it's lowkey one of my faves because it does so much for you and asks for basically nothing back. it's clk_hw_get_clk_prepared_enabled_kunit(9) β€” yes the name is a whole mouthful, we're gonna get through it together 🫢


✨ NAME ✨

clk_hw_get_clk_prepared_enabled_kunit β€” a test helper that does managed clk_hw_get_clk() plus clk_prepare_enable(), and cleans up after itself like the responsible icon it is πŸŽ€


🌸 SYNOPSIS 🌸

struct clk * clk_hw_get_clk_prepared_enabled_kunit (struct kunit *test ,
struct clk_hw *hw , const char *con_id );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • test β€” the test context, aka the main character of this whole situation πŸ‘‘
  • hw β€” the clk_hw associated with the clk being consumed, it's giving "the source of truth" energy
  • con_id β€” the connection ID string on device, iykyk

⭐ DESCRIPTION ⭐

so literally, it's just like this:

struct clk *clk = clk_hw_get_clk(...);
clk_prepare_enable(clk);

...except β€” and this is the slay part β€” the clk is managed by the test case. it gets automatically disabled and unprepared with clk_disable_unprepare, and put with clk_put, after the test case concludes. no manual teardown, no messy leftover state, no cap. you just vibe and the cleanup happens for you πŸ’–


πŸ”₯ RETURN πŸ”₯

a new clk consumer that is prepared and enabled ✨ β€” or ERR_PTR on failure 😭 (check for that one, bestie, fr fr)


πŸ’€ SEE ALSO πŸ’€

the whole kunit clk friend group, honestly 🧚


mwah πŸ’‹ that's the page! this little gem lives over in ./drivers/clk, it's dated October 2026, and the manual calls it clk_hw_get_...nabled_kunit(9) (yes, still abbreviated, we don't make the rules). see you in the next test case, bestie πŸŒˆπŸ’œ

πŸ“¦ where this page comes from