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.

Dependency Surface

Detected Declarations

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

Implementation Notes