module_wmi_driver(9)
π module_wmi_driver(9) β like, the Kernel API Manual bestie π
okay so real quick before anything: this is a section 9 page from the Kernel API Manual, and yes we are absolutely about to make a boring-sounding macro sound iconic β¨
πΈ NAME πΈ
module_wmi_driver β the helper macro that handles registering and unregistering a WMI driver for you, no cap π«Ά
π¦ SYNOPSIS π¦
module_wmi_driver (__wmi_driver );
β¨ ARGUMENTS β¨
__wmi_driverβ thewmi_driverstruct. that's it. that's the whole argument, she's a one-arg girlie π
π DESCRIPTION π
okay so picture this: you're writing a WMI driver and you literally do nothing special in module init/exit. like, nothing. and you're out here writing all that boilerplate anyway?? bestie no π
module_wmi_driver is the helper macro for exactly those drivers. it eliminates a lot of boilerplate, and honestly it ate. π₯
β οΈ two things, and they're important, so pay attention: - each module may only use this macro once β once, periodt π - calling it replacesmodule_initandmodule_exit
like it literally takes over for both of them. so don't go doubling up, iykyk π
π SEE ALSO π
kernel file ./include/linux/wmi.h, plus the whole friend group:
struct wmi_device(9)to_wmi_device(9)struct wmi_buffer(9)struct wmi_string(9)struct wmi_driver(9)to_wmi_driver(9)wmi_driver_register(9)
and that's the whole page, bestie π this lil gem lives in ./include/linux and the version i'm reading is dated October 2026, filed under module_wmi_driver(9) β go forth and register those drivers, you absolute main character π§ββοΈβ¨
π¦ 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