drivers/comedi/range.c
Source file repositories/reference/linux-study-clean/drivers/comedi/range.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/comedi/range.c- Extension
.c- Size
- 3899 bytes
- Lines
- 132
- Domain
- Driver Families
- Bucket
- drivers/comedi
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/uaccess.hlinux/comedi/comedidev.hcomedi_internal.h
Detected Declarations
function do_rangeinfo_ioctlfunction comedi_check_chanlistexport range_bipolar10export range_bipolar5export range_bipolar2_5export range_unipolar10export range_unipolar5export range_unipolar2_5export range_0_20mAexport range_4_20mAexport range_0_32mAexport range_unknownexport comedi_check_chanlist
Annotated Snippet
CR_RANGE(chanspec) >= range_len) {
dev_warn(dev->class_dev,
"bad chanlist[%d]=0x%08x chan=%d range length=%d\n",
i, chanspec, chan, range_len);
return -EINVAL;
}
}
return 0;
}
EXPORT_SYMBOL_GPL(comedi_check_chanlist);
Annotation
- Immediate include surface: `linux/uaccess.h`, `linux/comedi/comedidev.h`, `comedi_internal.h`.
- Detected declarations: `function do_rangeinfo_ioctl`, `function comedi_check_chanlist`, `export range_bipolar10`, `export range_bipolar5`, `export range_bipolar2_5`, `export range_unipolar10`, `export range_unipolar5`, `export range_unipolar2_5`, `export range_0_20mA`, `export range_4_20mA`.
- Atlas domain: Driver Families / drivers/comedi.
- Implementation status: integration implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
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.