Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b9adf469 authored by Brian Norris's avatar Brian Norris
Browse files

mtd: partitions: make parsers return 'const' partition arrays



We only want to modify these arrays inside the parser "drivers", so the
drivers should construct them however they like, then return them as
immutable arrays.

This will make other refactorings easier.

Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent c3168d26
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -162,7 +162,7 @@ afs_read_iis_v1(struct mtd_info *mtd, struct image_info_v1 *iis, u_int ptr)
}

static int parse_afs_partitions(struct mtd_info *mtd,
				struct mtd_partition **pparts,
				const struct mtd_partition **pparts,
				struct mtd_part_parser_data *data)
{
	struct mtd_partition *parts;
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ struct ar7_bin_rec {
};

static int create_mtd_partitions(struct mtd_info *master,
				 struct mtd_partition **pparts,
				 const struct mtd_partition **pparts,
				 struct mtd_part_parser_data *data)
{
	struct ar7_bin_rec header;
+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ static const char *bcm47xxpart_trx_data_part_name(struct mtd_info *master,
}

static int bcm47xxpart_parse(struct mtd_info *master,
			     struct mtd_partition **pparts,
			     const struct mtd_partition **pparts,
			     struct mtd_part_parser_data *data)
{
	struct mtd_partition *parts;
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ static int bcm63xx_detect_cfe(struct mtd_info *master)
}

static int bcm63xx_parse_cfe_partitions(struct mtd_info *master,
					struct mtd_partition **pparts,
					const struct mtd_partition **pparts,
					struct mtd_part_parser_data *data)
{
	/* CFE, NVRAM and global Linux are always present */
+1 −1
Original line number Diff line number Diff line
@@ -304,7 +304,7 @@ static int mtdpart_setup_real(char *s)
 * the first one in the chain if a NULL mtd_id is passed in.
 */
static int parse_cmdline_partitions(struct mtd_info *master,
				    struct mtd_partition **pparts,
				    const struct mtd_partition **pparts,
				    struct mtd_part_parser_data *data)
{
	unsigned long long offset;
Loading