clk_hw_get_clk_kunit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 β€” the clk_hw that'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:


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