drm_kunit_a...stroy_action(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_kunit_add_mode_destroy_action(9) β€” from the Kernel API Manual, bestie ✨

okay so real talk, this one lives in the Kernel API Manual and it's lowkey one of those tiny helper functions that just works so you don't have to. it's giving "cleanup crew, but make it kunit." πŸ§ΉπŸ’–


✨ NAME ✨

drm_kunit_add_mode_destroy_action β€” adds a drm_destroy_mode kunit action. that's it, that's the whole vibe πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

int drm_kunit_add_mode_destroy_action (struct kunit *test , struct
drm_display_mode *mode );

🌸 ARGUMENTS 🌸

  • test β€” the test context object, aka the main character of your kunit test 🫢
  • mode β€” the drm_display_mode that's gonna get destroyed eventually. it's on its own little timer, no cap πŸ’€

πŸ’œ DESCRIPTION πŸ’œ

so what it does: it registers a kunit action that will destroy the drm_display_mode at the end of the test. set it and forget it energy, honestly iconic πŸ‘‘

and if an error occurs, the drm_display_mode will be destroyed. like, either way it's getting cleaned up β€” the mode does NOT survive the test, periodt πŸ’…


⭐ RETURN ⭐

0 on success, an error code otherwise. slay when it's zero, 😭 when it's not.


πŸ”₯ SEE ALSO πŸ”₯


bestie warning 🚨: the destruction happens whether or not things go your way β€” that's the whole point, so don't go assuming you get to keep the mode around after the test. πŸ™ˆ

kisses, this page came to you from ./drivers/gpu/drm/tests and it's dated October 2026 β€” go forth and write tests that clean up after themselves, mwah πŸ’‹πŸŒˆ

πŸ“¦ where this page comes from