clk_hw_get_clk_kunit(9)
π clk_hw_get_clk_kunit(9) π
okay bestie, welcome to the Kernel API Manual β¨ this one lives in section 9 and it's literally the kunit-managed glow-up of clk_hw_get_clk(). let's get into it π
β¨ NAME β¨
clk_hw_get_clk_kunit β the test-managed version of clk_hw_get_clk(), no cap π«Ά
π¦ SYNOPSIS π¦
struct clk * clk_hw_get_clk_kunit (struct kunit *test , struct clk_hw
*hw , const char *con_id );
like, that's the whole signature. struct clk pointer coming at ya, three args, we move π
πΈ ARGUMENTS πΈ
testβ the test context, aka your kunit bestie holding the vibes together π§hwβ theclk_hwthat's associated with the clk being consumed πcon_idβ the connection ID string on the device, yep that's the one π
π₯ DESCRIPTION π₯
so it's just like clk_hw_get_clk, except β and this is the iconic part β the clk is managed by the test case, and it gets automatically put with clk_put after the test case concludes. like, you don't even have to clean up after yourself, the framework does it for you. main character energy fr fr β
π RETURN π
a new clk consumer π β¦ or ERR_PTR on failure π (iykyk, always check for the error pointer, don't just vibe-check it and move on)
π SEE ALSO π
kernel file: ./drivers/clk/clk_kunit_helpers.c ποΈ
the whole friend group:
clk_prepare_enable_kunit(9)clk_get_kunit(9)of_clk_get_kunit(9)clk_hw_get_clk_prepared_enabled_kunit(9)clk_hw_register_kunit(9)of_clk_hw_register_kunit(9)of_clk_add_hw_provider_kunit(9)
ok that's the page!! now go write some tests and let the cleanup handle itself, you deserve it π β¨
and that's a wrap, babe π«Ά this one's from ./drivers/clk, dated October 2026, and it's clk_hw_get_clk_kunit(9) all day π slay π
π¦ 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