module_wmi_driver(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the wmi_driver struct. 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 replaces module_init and module_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:


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