drivers/mtd/mtdcore.c
Source file repositories/reference/linux-study-clean/drivers/mtd/mtdcore.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mtd/mtdcore.c- Extension
.c- Size
- 69302 bytes
- Lines
- 2661
- Domain
- Driver Families
- Bucket
- drivers/mtd
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/kernel.hlinux/ptrace.hlinux/seq_file.hlinux/string.hlinux/timer.hlinux/major.hlinux/fs.hlinux/err.hlinux/ioctl.hlinux/init.hlinux/of.hlinux/proc_fs.hlinux/idr.hlinux/backing-dev.hlinux/gfp.hlinux/random.hlinux/slab.hlinux/reboot.hlinux/leds.hlinux/debugfs.hlinux/nvmem-provider.hlinux/root_dev.hlinux/error-injection.hlinux/mtd/mtd.hlinux/mtd/partitions.hlinux/mtd/concat.hmtdcore.h
Detected Declarations
function mtd_cls_suspendfunction mtd_cls_resumefunction releasefunction mtd_device_releasefunction DEVICE_ATTRfunction mtd_flags_showfunction mtd_size_showfunction mtd_erasesize_showfunction mtd_writesize_showfunction mtd_subpagesize_showfunction mtd_oobsize_showfunction mtd_oobavail_showfunction mtd_numeraseregions_showfunction mtd_name_showfunction mtd_ecc_strength_showfunction mtd_bitflip_threshold_showfunction mtd_bitflip_threshold_storefunction mtd_ecc_step_size_showfunction mtd_corrected_bits_showfunction mtd_ecc_failures_showfunction mtd_bad_blocks_showfunction mtd_bbt_blocks_showfunction mtd_check_expert_analysis_modefunction mtd_ooblayout_showfunction mtd_ooblayout_ecc_showfunction mtd_ooblayout_free_showfunction mtd_debugfs_populatefunction mtd_mmap_capabilitiesfunction mtd_reboot_notifierfunction mtd_wunit_to_pairing_infofunction mtd_pairing_info_to_wunitfunction mtd_pairing_groupsfunction mtd_nvmem_reg_readfunction mtd_nvmem_addfunction mtd_check_of_nodefunction add_mtd_devicefunction del_mtd_devicefunction mtd_set_dev_defaultsfunction mtd_otp_sizefunction mtd_nvmem_user_otp_reg_readfunction mtd_nvmem_fact_otp_reg_readfunction mtd_otp_nvmem_addfunction parsingfunction mtd_device_unregisterfunction register_mtd_userfunction unregister_mtd_userfunction __get_mtd_devicefunction mtd_for_each_device
Annotated Snippet
module_init(init_mtd);
module_exit(cleanup_mtd);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
MODULE_DESCRIPTION("Core MTD registration and access routines");
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/ptrace.h`, `linux/seq_file.h`, `linux/string.h`, `linux/timer.h`, `linux/major.h`, `linux/fs.h`.
- Detected declarations: `function mtd_cls_suspend`, `function mtd_cls_resume`, `function release`, `function mtd_device_release`, `function DEVICE_ATTR`, `function mtd_flags_show`, `function mtd_size_show`, `function mtd_erasesize_show`, `function mtd_writesize_show`, `function mtd_subpagesize_show`.
- Atlas domain: Driver Families / drivers/mtd.
- Implementation status: integration implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.