module_hid_driver(9)
π module_hid_driver β like, the manual page, bestie β¨
Okay so you found the man page for module_hid_driver, which lives in the Kernel API Manual (section 9, iykyk) β and honestly? It's a little guy with a big job, so let's get into it π«Ά
β¨ NAME β¨
module_hid_driver β the helper macro for registering a HID driver. That's it, that's the whole vibe π
πΈ SYNOPSIS πΈ
module_hid_driver (__hid_driver );
Literally one argument, she's low maintenance π
π ARGUMENTS π
__hid_driverβ ahid_driverstruct. That's the whole thing, no cap. Hand her the struct and she does the rest π¦
π DESCRIPTION π
So here's the tea: this is a helper macro for HID drivers that literally do nothing special in module init/exit. Like, if your driver's init and exit are just vibing and doing zero extra work, this macro is your girl π
It eliminates a lot of boilerplate β all that copy-paste code you'd otherwise be writing? Gone. Not me being obsessed with a macro, but here we are π§
β Important, bestie, fr fr: each module may only use this macro once. One and done. No double-dipping π
And the way that it works: calling it replaces module_init and module_exit. So don't also go calling those yourself β this macro is them now. Main character energy π
π₯ SEE ALSO π₯
Starting with the kernel file itself: ./include/linux/hid.h β go read it, she's iconic π
Then the whole squad:
HID quirks(9)struct hid_battery(9)struct hid_driver(9)struct hid_ll_driver(9)hid_device_io_start(9)hid_device_io_stop(9)hid_map_usage(9)hid_map_usage_clear(9)hid_parse(9)hid_hw_power(9)hid_hw_idle(9)hid_hw_may_wakeup(9)hid_hw_wait(9)hid_report_len(9)
Go read them, they all ate π β¨
And that's the page! Signing off from the ./include/linux directory, Kernel API Manual edition, dated October 2026 β catch you in the next man page, bestie ππ¦π
π¦ 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