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.

Dependency Surface

Detected Declarations

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

Implementation Notes