of_clk_get_kunit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… of_clk_get_kunit(9)

okay so bestie, welcome to the Kernel API Manual ✨ this one is a tiny little helper that's giving very "test-only, don't @ me" energy and honestly? iconic behavior. let's get into it πŸŽ€


✨ NAME ✨

of_clk_get_kunit β€” the test-managed glow-up of of_clk_get() πŸ¦‹


🌸 SYNOPSIS 🌸

struct clk * of_clk_get_kunit (struct kunit *test , struct device_node
*np , int index );

like yes, that's the whole signature, no cap πŸ’…


πŸ’– ARGUMENTS πŸ’–

  • test β€” the test context πŸ§ͺ like, the whole vibe of the test case lives here
  • np β€” the device_node for the clock "consumer" πŸ‘€ (yes "consumer" in quotes, the quotes are doing work)
  • index β€” the index in the 'clocks' property of np πŸ”’

πŸ‘‘ DESCRIPTION πŸ‘‘

so literally just like of_clk_get(), except the clk is managed by the test case β€” meaning it gets automatically clk_put when the test case concludes 🫢 set it and forget it, she cleans up after herself, main character energy fr fr ✨


⭐ RETURN ⭐

a new clk consumer πŸŽ€ or ERR_PTR on failure 😭 (check it bestie, always check it)


🌈 SEE ALSO 🌈

the whole kunit clock friend group, obsessed πŸ’œ


mwah πŸ’‹ this little page came from ./drivers/clk, dated October 2026, and it's filed under of_clk_get_kunit(9) β€” slay, go write some tests bestie 🧚

πŸ“¦ where this page comes from