Lines Matching +full:partitions +full:- +full:table +full:- +full:offset

1 // SPDX-License-Identifier: GPL-2.0-only
9 #include <linux/mtd/partitions.h>
27 u32 offset; in mtd_parser_tplink_safeloader_read_table() local
35 np = of_get_child_by_name(np, "partitions"); in mtd_parser_tplink_safeloader_read_table()
37 if (of_property_read_u32(np, "partitions-table-offset", &offset)) { in mtd_parser_tplink_safeloader_read_table()
38 pr_err("Failed to get partitions table offset\n"); in mtd_parser_tplink_safeloader_read_table()
42 err = mtd_read(mtd, offset, sizeof(hdr), &bytes_read, (uint8_t *)&hdr); in mtd_parser_tplink_safeloader_read_table()
44 pr_err("Failed to read from %s at 0x%x\n", mtd->name, offset); in mtd_parser_tplink_safeloader_read_table()
54 err = mtd_read(mtd, offset + sizeof(hdr), size, &bytes_read, buf); in mtd_parser_tplink_safeloader_read_table()
56 pr_err("Failed to read from %s at 0x%zx\n", mtd->name, offset + sizeof(hdr)); in mtd_parser_tplink_safeloader_read_table()
79 size_t offset; in mtd_parser_tplink_safeloader_parse() local
87 err = -ENOMEM; in mtd_parser_tplink_safeloader_parse()
93 err = -ENOENT; in mtd_parser_tplink_safeloader_parse()
97 for (idx = 0, offset = TPLINK_SAFELOADER_DATA_OFFSET; in mtd_parser_tplink_safeloader_parse()
99 sscanf(buf + offset, "partition %64s base 0x%llx size 0x%llx%zn\n", in mtd_parser_tplink_safeloader_parse()
100 name, &parts[idx].offset, &parts[idx].size, &bytes) == 3; in mtd_parser_tplink_safeloader_parse()
101 idx++, offset += bytes + 1) { in mtd_parser_tplink_safeloader_parse()
104 err = -ENOMEM; in mtd_parser_tplink_safeloader_parse()
110 pr_warn("Reached maximum number of partitions!\n"); in mtd_parser_tplink_safeloader_parse()
119 for (idx -= 1; idx >= 0; idx--) in mtd_parser_tplink_safeloader_parse()
139 { .compatible = "tplink,safeloader-partitions" },
147 .name = "tplink-safeloader",
152 MODULE_DESCRIPTION("TP-Link Safeloader partitions parser");