clk_hw_regis...d_rate_kunit(9)
π clk_hw_register_fixed_rate_kunit π
okay so bestie, this is a Kernel API Manual page, section 9 β and it's genuinely one of those little helper functions that makes testing clock drivers not a whole ordeal. It lives in the kernel, it's doing the most, and it's here to help you test-register a fixed-rate clock. periodt β¨
πΈ NAME πΈ
clk_hw_register_fixed_rate_kunit β it's the test-managed version of __clk_hw_register_fixed_rate(). like, the same energy, but it knows it's inside a KUnit test and it handles itself accordingly π
π¦ SYNOPSIS π¦
struct clk_hw * clk_hw_register_fixed_rate_kunit (struct kunit *test ,
struct clk_hw_fixed_rate_kunit_params *params );
that's it, that's the whole vibe check. it hands you back a struct clk_hw * β or it doesn't, and we'll get to that π₯
β¨ ARGUMENTS β¨
testβ your test context π§ it's thestruct kunit *that tells everything "yes, we're inside a test right now, act accordingly."paramsβ the actual arguments that get passed straight through to__clk_hw_register_fixed_rate. lowkey the important one, honestly π«Ά
π RETURN π
you get back the registered fixed-rate clk_hw β iconic, perfect, exactly what you wanted.
or, if things go sideways, you get an ERR_PTR on failure. so like, always check it bestie, don't just assume. IS_ERR() is your friend fr fr π
π SEE ALSO π
- the kernel file
./drivers/clk/clk-fixed-rate_test.cβ that's the whole reason this exists, go read it π clk_hw_fixed_rate_kunit_params(9)β the struct thatparamspoints at, the blueprint of it all πclk_hw_unregister_fixed_rate_kunit(9)β the cleanup bestie, because what goes up must come down π
ngl this whole thing is test-only territory β it's built for KUnit so it can do the managed-registration thing. don't be out here using it in production driver code, that's not the assignment π«
and that's the page!! source lives in ./drivers/clk (the kernel tree, obviously), dated October 2026, and this little Kernel API Manual entry was brought to you by that same path β mwah, go write some tests, you're gonna 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