class_destroy(9)
β¨ class_destroy(9) β¨
okay bestie, so this one is a little kernel API manual page β class_destroy(9) β and honestly? it's giving "short but important" energy. no cap, it's a tiny one, but you need to know it. let's get into it π
πΈ NAME πΈ
class_destroy β destroys a struct class structure. literally what it says on the tin, bestie. it's the cleanup bestie to class_create. π«Ά
π¦ SYNOPSIS π¦
void class_destroy (const struct class *cls );
that's it. that's the whole signature. void return, one argument, no drama. β¨
π ARGUMENTS π
clsβ pointer to thestruct classthat is to be destroyed. like, the actual one you want gone. not a copy, not a vibe, the pointer itself. π
π DESCRIPTION π
okay so the one thing to remember here, and i mean the thing:
Note, the pointer to be destroyed must have been created with a call to class_create.
fr fr. if you didn't make it with class_create, do not hand it to class_destroy. that's the whole rule. it's not a suggestion, it's the rule. π
π SEE ALSO π
- Kernel file
./drivers/base/class.c class_to_subsys(9)class_create(9)class_dev_iter_init(9)class_dev_iter_next(9)class_dev_iter_exit(9)class_for_each_device(9)class_find_device(9)class_compat_register(9)class_compat_unregister(9)class_compat_create_link(9)class_compat_remove_link(9)class_is_registered(9)
like, go read class_create(9) first if you're confused β they're literally a matched set, iykyk. π₯
β sign-off β
this iconic little number lives in ./drivers/base, and it's dated October 2026 β so yeah, she's from the future (or at least the kernel's version of it π). go forth and clean up your classes responsibly, bestie. mwah. π§π
π¦ 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