kunit_platform_device_alloc(9)
β¨ kunit_platform_device_alloc(9) β¨
okay so bestie, this one's from the Kernel API Manual β it's the kunit_platform_device_alloc page, and honestly it's giving "tiny function, big responsibilities" energy π
πΈ NAME πΈ
kunit_platform_device_alloc β allocate a KUnit test managed platform device π
π¦ SYNOPSIS π¦
struct platform_device * kunit_platform_device_alloc (struct kunit *test
, const char *name , int id );
π ARGUMENTS π
testβ the test context, like the group chat this whole operation lives in π«Άnameβ the device name of the platform device you're alloc-ing, iykykidβ the identifier of the platform device you're alloc-ing.
π DESCRIPTION π
So you allocate a test managed platform device β¨ and the best part? The device gets put automatically when the test completes. Literally self-cleaning, main character energy π₯ no cap.
β RETURN β
- Allocated platform device on success π
NULLon failure π
π§ SEE ALSO π§
- Kernel file
./lib/kunit/platform.c kunit_platform_device_add(9)kunit_platform_device_register_full(9)kunit_platform_device_unregister(9)kunit_platform_device_prepare_wait_for_probe(9)kunit_platform_driver_register(9)
and that's the whole page, bestie β go forth and allocate responsibly π
this cutie lives in ./lib/kunit and the page is dated October 2026 πΈ so yeah, it's basically from the future fr fr π¦π«
mwah, go slay some kernel tests π β¨π
π¦ 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