clk_hw_get_...nabled_kunit(9)
π 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β theclk_hwassociated with the clk being consumed, it's giving "the source of truth" energycon_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 π
- Kernel file
./drivers/clk/clk_kunit_helpers.cβ go read it, it's iconic clk_prepare_enable_kunit(9)clk_get_kunit(9)of_clk_get_kunit(9)clk_hw_get_clk_kunit(9)clk_hw_register_kunit(9)of_clk_hw_register_kunit(9)of_clk_add_hw_provider_kunit(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms