module_hid_driver(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” a hid_driver struct. 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:

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