module_pci_driver(9)
π module_pci_driver β the Kernel API Manual tea π«Ά
Okay so bestie, welcome to module_pci_driver, one of those tiny little kernel macros that lowkey carries your whole PCI driver setup on its back. It's living over in the Kernel API Manual, and honestly? It's giving "small but mighty." β¨
πΈ NAME πΈ
module_pci_driver β the helper macro for registering a PCI driver, periodt π
π¦ SYNOPSIS π¦
module_pci_driver (__pci_driver );
That's the whole vibe. One macro, one argument, iconic. π
β ARGUMENTS β
__pci_driverβ apci_driverstruct, bestie. That's the one thing you hand over and it handles the rest π«Ά
π DESCRIPTION π
So here's the tea β β this is a helper macro for PCI drivers that literally do nothing special in module init/exit. Like, nothing. No extra setup, no little rituals, no secret handshake. And because of that, this macro justβ¦ handles it for you. It eliminates a lot of boilerplate, and we love a macro that eats the boring parts. π₯
β οΈ Important caveat, no cap: each module may only use this macro once, and calling it replacesmodule_initandmodule_exit. So don't go doubling up on it β it's a one-and-done situation, main character energy only. π
π SEE ALSO π
Y'all want the whole friend group? Here's everybody, hanging out in the Kernel file ./include/linux/pci.h:
enum pci_interrupt_pin(9)pci_channel_state_t(9)pci_is_bridge(9)pci_is_vga(9)pci_is_display(9)struct pci_driver(9)PCI_DEVICE(9)PCI_DEVICE_DRIVER_OVERRIDE(9)PCI_DRIVER_OVERRIDE_DEVICE_VFIO(9)PCI_DEVICE_SUB(9)PCI_DEVICE_CLASS(9)PCI_VDEVICE(9)PCI_VDEVICE_SUB(9)PCI_DEVICE_DATA(9)pcie_capability_clear_and_set_word(9)pci_bus_for_each_resource(9)builtin_pci_driver(9)pci_irq_type(9)pci_irqd_intx_xlate(9)pci_resource_is_io(9)pci_resource_is_mem(9)pci_pcie_cap(9)pci_is_pcie(9)pcie_caps_reg(9)pci_pcie_type(9)pcie_find_root_port(9)pci_vpd_alloc(9)pci_vpd_find_id_string(9)pci_vpd_find_ro_info_keyword(9)pci_vpd_check_csum(9)pci_ari_enabled(9)pci_is_thunderbolt_attached(9)
Go read them, iykyk πβ¨
π THE CUTE SIGN-OFF π
This lil masterpiece lives in ./include/linux, and the version we're looking at is dated October 2026. Manual name? module_pci_driver(9), obviously. Slay, go write your PCI driver, and remember β one macro per module, no cap π§π
π¦ 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