clk_get_kunit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ clk_get_kunit(9) ✨

okay so real talk, this is a page from the Kernel API Manual, and it's literally about clk_get_kunit β€” bestie, it's a test-managed version of clk_get() πŸ’…


🌸 NAME 🌸

clk_get_kunit β€” it's the Test managed clk_get(), no cap πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

struct clk * clk_get_kunit (struct kunit *test , struct device *dev ,
const char *con_id );

like, that's the whole vibe right there ✨


πŸ’– ARGUMENTS πŸ’–

  • test β€” the test context πŸ§ͺ this is the struct kunit * running the show, main character energy
  • dev β€” the device for the clock "consumer" πŸ“± yes the quotes are in the original, it's giving very intentional
  • con_id β€” the clock consumer ID 🌈 the name the consumer knows it by

πŸ‘‘ DESCRIPTION πŸ‘‘

Just like clk_get, bestie β€” except the clk is managed by the test case πŸ’« and it's automatically put with clk_put after the test case concludes. so you literally don't have to clean up after yourself, which is iconic behavior honestly 🫢


πŸ”₯ RETURN πŸ”₯

  • a new clk consumer πŸŽ‰
  • or ERR_PTR on failure 😭 (check it, fr fr, don't just yolo it)

⭐ SEE ALSO ⭐

Kernel file ./drivers/clk/clk_kunit_helpers.c πŸ“‚ β€” go read it, iykyk

all the kunit clk besties, assembled πŸŒΈπŸ’œ


ngl the whole point is: use this instead of raw clk_get inside a test and the test framework handles the clk_put for you. slay.

that's the whole page, mwah πŸ’‹ β€” brought to you by the ./drivers/clk crew, dated October 2026, and yeah the manual name is clk_get_kunit(9) in case you forgot already πŸ™ˆ bye bestie, go write some tests πŸŽ€βœ¨

πŸ“¦ where this page comes from