drivers/comedi/proc.c
Source file repositories/reference/linux-study-clean/drivers/comedi/proc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/comedi/proc.c- Extension
.c- Size
- 1772 bytes
- Lines
- 75
- Domain
- Driver Families
- Bucket
- drivers/comedi
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/comedi/comedidev.hcomedi_internal.hlinux/proc_fs.hlinux/seq_file.h
Detected Declarations
function Copyrightfunction comedi_proc_initfunction comedi_proc_cleanup
Annotated Snippet
if (dev->attached) {
devices_q = 1;
seq_printf(m, "%2d: %-20s %-20s %4d\n",
i, dev->driver->driver_name,
dev->board_name, dev->n_subdevices);
}
up_read(&dev->attach_lock);
comedi_dev_put(dev);
}
if (!devices_q)
seq_puts(m, "no devices\n");
mutex_lock(&comedi_drivers_list_lock);
for (driv = comedi_drivers; driv; driv = driv->next) {
seq_printf(m, "%s:\n", driv->driver_name);
for (i = 0; i < driv->num_names; i++)
seq_printf(m, " %s\n",
*(char **)((char *)driv->board_name +
i * driv->offset));
if (!driv->num_names)
seq_printf(m, " %s\n", driv->driver_name);
}
mutex_unlock(&comedi_drivers_list_lock);
return 0;
}
void __init comedi_proc_init(void)
{
if (!proc_create_single("comedi", 0444, NULL, comedi_read))
pr_warn("comedi: unable to create proc entry\n");
}
void comedi_proc_cleanup(void)
{
remove_proc_entry("comedi", NULL);
}
Annotation
- Immediate include surface: `linux/comedi/comedidev.h`, `comedi_internal.h`, `linux/proc_fs.h`, `linux/seq_file.h`.
- Detected declarations: `function Copyright`, `function comedi_proc_init`, `function comedi_proc_cleanup`.
- Atlas domain: Driver Families / drivers/comedi.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.