drivers/mtd/parsers/ofpart_bcm4908.c
Source file repositories/reference/linux-study-clean/drivers/mtd/parsers/ofpart_bcm4908.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mtd/parsers/ofpart_bcm4908.c- Extension
.c- Size
- 1402 bytes
- Lines
- 68
- Domain
- Driver Families
- Bucket
- drivers/mtd
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/init.hlinux/of.hlinux/mtd/mtd.hlinux/slab.hlinux/mtd/partitions.hofpart_bcm4908.h
Detected Declarations
function Copyrightfunction of_property_for_each_stringfunction bcm4908_partitions_post_parse
Annotated Snippet
if (err) {
pr_err("failed to parse %s\n", s + len + 1);
of_node_put(root);
return err;
}
of_node_put(root);
return offset << 10;
}
of_node_put(root);
return -ENOENT;
}
int bcm4908_partitions_post_parse(struct mtd_info *mtd, struct mtd_partition *parts, int nr_parts)
{
long long fw_offset;
int i;
fw_offset = bcm4908_partitions_fw_offset();
for (i = 0; i < nr_parts; i++) {
if (of_device_is_compatible(parts[i].of_node, "brcm,bcm4908-firmware")) {
if (fw_offset < 0 || parts[i].offset == fw_offset)
parts[i].name = "firmware";
else
parts[i].name = "backup";
}
}
return 0;
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/init.h`, `linux/of.h`, `linux/mtd/mtd.h`, `linux/slab.h`, `linux/mtd/partitions.h`, `ofpart_bcm4908.h`.
- Detected declarations: `function Copyright`, `function of_property_for_each_string`, `function bcm4908_partitions_post_parse`.
- Atlas domain: Driver Families / drivers/mtd.
- Implementation status: source 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.