/* Pull of_node from the master device node */
mtd_node = mtd_get_of_node(master); if (!mtd_node) return0;
if (!master->parent) { /* Master */
ofpart_node = of_get_child_by_name(mtd_node, "partitions"); if (!ofpart_node) { /* *Wemightgethereevenwhenofpartisn'tusedatall(e.g., *whenusinganotherparser),sodon'tbelouderthan *KERN_DEBUG
*/
pr_debug("%s: 'partitions' subnode not found on %pOF. Trying to parse direct subnodes as partitions.\n",
master->name, mtd_node);
ofpart_node = mtd_node;
dedicated = false;
}
} else { /* Partition */
ofpart_node = mtd_node;
}
of_id = of_match_node(parse_ofpart_match_table, ofpart_node); if (dedicated && !of_id) { /* The 'partitions' subnode might be used by another parser */ return0;
}
quirks = of_id ? of_id->data : NULL;
/* First count the subnodes */
nr_parts = 0;
for_each_child_of_node(ofpart_node, pp) { if (!dedicated && node_has_compatible(pp)) continue;
nr_parts++;
}
if (nr_parts == 0) return0;
parts = kcalloc(nr_parts, sizeof(*parts), GFP_KERNEL); if (!parts) return -ENOMEM;
i = 0;
for_each_child_of_node(ofpart_node, pp) { const __be32 *reg; int len; int a_cells, s_cells;
if (!dedicated && node_has_compatible(pp)) continue;
for (i = 0; i < nr_parts; i++) {
parts[i].offset = be32_to_cpu(part->offset);
parts[i].size = be32_to_cpu(part->len) & ~1; /* bit 0 set signifies read only partition */ if (be32_to_cpu(part->len) & 1)
parts[i].mask_flags = MTD_WRITEABLE;
if (names && (plen > 0)) { int len = strlen(names) + 1;
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Parser for MTD partitioning information in device tree");
MODULE_AUTHOR("Vitaly Wool, David Gibson"); /* *WhenMTDcorecannotfindtherequestedparser,ittriestoloadthemodule *withthesamename.Sinceweprovidetheofoldpartparser,weshouldhave *thecorrespondingalias.
*/
MODULE_ALIAS("fixed-partitions");
MODULE_ALIAS("ofoldpart");
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.