Lines Matching +full:fixed +full:- +full:partitions
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Flash partitions described by the OF (or flattened) device tree
17 #include <linux/mtd/partitions.h>
42 ofpart_node = of_get_child_by_name(mtd_node, "partitions"); in parse_fixed_partitions()
49 …pr_debug("%s: 'partitions' subnode not found on %pOF. Trying to parse direct subnodes as partition… in parse_fixed_partitions()
50 master->name, mtd_node); in parse_fixed_partitions()
53 } else if (!of_device_is_compatible(ofpart_node, "fixed-partitions")) { in parse_fixed_partitions()
54 /* The 'partitions' subnode might be used by another parser */ in parse_fixed_partitions()
72 return -ENOMEM; in parse_fixed_partitions()
87 master->name, pp, in parse_fixed_partitions()
91 nr_parts--; in parse_fixed_partitions()
100 master->name, pp, in parse_fixed_partitions()
114 if (of_get_property(pp, "read-only", &len)) in parse_fixed_partitions()
120 if (of_property_read_bool(pp, "slc-mode")) in parse_fixed_partitions()
134 master->name, pp, mtd_node); in parse_fixed_partitions()
135 ret = -EINVAL; in parse_fixed_partitions()
143 { .compatible = "fixed-partitions" },
150 .name = "fixed-partitions",
171 part = of_get_property(dp, "partitions", &plen); in parse_ofoldpart_partitions()
173 return 0; /* No partitions found */ in parse_ofoldpart_partitions()
181 return -ENOMEM; in parse_ofoldpart_partitions()
183 names = of_get_property(dp, "partition-names", &plen); in parse_ofoldpart_partitions()
186 parts[i].offset = be32_to_cpu(part->offset); in parse_ofoldpart_partitions()
187 parts[i].size = be32_to_cpu(part->len) & ~1; in parse_ofoldpart_partitions()
189 if (be32_to_cpu(part->len) & 1) in parse_ofoldpart_partitions()
196 plen -= len; in parse_ofoldpart_partitions()
238 MODULE_ALIAS("fixed-partitions");