drivers/comedi/comedi_pci.c
Source file repositories/reference/linux-study-clean/drivers/comedi/comedi_pci.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/comedi/comedi_pci.c- Extension
.c- Size
- 6693 bytes
- Lines
- 217
- Domain
- Driver Families
- Bucket
- drivers/comedi
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/interrupt.hlinux/comedi/comedi_pci.h
Detected Declarations
function Copyrightfunction comedi_pci_enablefunction comedi_pci_disablefunction comedi_pci_detachfunction comedi_pci_auto_configfunction comedi_pci_auto_unconfigfunction comedi_pci_driver_registerfunction comedi_pci_driver_unregisterexport comedi_to_pci_devexport comedi_pci_enableexport comedi_pci_disableexport comedi_pci_detachexport comedi_pci_auto_configexport comedi_pci_auto_unconfigexport comedi_pci_driver_registerexport comedi_pci_driver_unregister
Annotated Snippet
struct pci_driver *pci_driver)
{
int ret;
ret = comedi_driver_register(comedi_driver);
if (ret < 0)
return ret;
ret = pci_register_driver(pci_driver);
if (ret < 0) {
comedi_driver_unregister(comedi_driver);
return ret;
}
return 0;
}
EXPORT_SYMBOL_GPL(comedi_pci_driver_register);
/**
* comedi_pci_driver_unregister() - Unregister a PCI COMEDI driver
* @comedi_driver: COMEDI driver to be unregistered.
* @pci_driver: PCI driver to be unregistered.
*
* This function is called from the module_exit() of PCI COMEDI driver modules
* to unregister the PCI driver and the COMEDI driver. Do not call it
* directly, use the module_comedi_pci_driver() helper macro instead.
*/
void comedi_pci_driver_unregister(struct comedi_driver *comedi_driver,
struct pci_driver *pci_driver)
{
pci_unregister_driver(pci_driver);
comedi_driver_unregister(comedi_driver);
}
EXPORT_SYMBOL_GPL(comedi_pci_driver_unregister);
MODULE_AUTHOR("https://www.comedi.org");
MODULE_DESCRIPTION("Comedi PCI interface module");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/module.h`, `linux/interrupt.h`, `linux/comedi/comedi_pci.h`.
- Detected declarations: `function Copyright`, `function comedi_pci_enable`, `function comedi_pci_disable`, `function comedi_pci_detach`, `function comedi_pci_auto_config`, `function comedi_pci_auto_unconfig`, `function comedi_pci_driver_register`, `function comedi_pci_driver_unregister`, `export comedi_to_pci_dev`, `export comedi_pci_enable`.
- Atlas domain: Driver Families / drivers/comedi.
- Implementation status: pattern implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.