]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mtd: partitions: make parsers return 'const' partition arrays
authorBrian Norris <computersforpeace@gmail.com>
Fri, 4 Dec 2015 23:25:14 +0000 (15:25 -0800)
committerBrian Norris <computersforpeace@gmail.com>
Wed, 9 Dec 2015 18:21:57 +0000 (10:21 -0800)
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: Brian Norris <computersforpeace@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/afs.c
drivers/mtd/ar7part.c
drivers/mtd/bcm47xxpart.c
drivers/mtd/bcm63xxpart.c
drivers/mtd/cmdlinepart.c
drivers/mtd/ofpart.c
drivers/mtd/redboot.c
include/linux/mtd/partitions.h

index e02dae3b739bd0b7068711e09fd6ce2595866812..d61b7edfc9382383edbd0cbb6374790a889ab444 100644 (file)
@@ -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;
index 9203b96fd78922ef9a004017c1cb11fd553d45af..90575deff0ae5d3c699ba65558c69650cc1d652a 100644 (file)
@@ -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;
index 92a6dd18198be44d98cda2bf7b84559ba15a310d..8282f47bcf5d374e03d343453d62ee0bc4851785 100644 (file)
@@ -82,7 +82,7 @@ out_default:
 }
 
 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;
index cf02135320bce5f41c60a0a43f60061d042063dc..44093699859321ce4164ed63d368ec8b72c5d49b 100644 (file)
@@ -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 */
index 420489864bc2d2a4243b705391050f1ebe6d9a2d..fbd5affc0acfe3fe410b5193d8bee8c40884e10f 100644 (file)
@@ -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;
index c7df2f1dd6b8d704e26176401c37342509bc5940..ede407d6e1068826edeebcf1472ab68c12c1fb2d 100644 (file)
@@ -26,7 +26,7 @@ static bool node_has_compatible(struct device_node *pp)
 }
 
 static int parse_ofpart_partitions(struct mtd_info *master,
-                                  struct mtd_partition **pparts,
+                                  const struct mtd_partition **pparts,
                                   struct mtd_part_parser_data *data)
 {
        struct mtd_partition *parts;
@@ -145,7 +145,7 @@ static struct mtd_part_parser ofpart_parser = {
 };
 
 static int parse_ofoldpart_partitions(struct mtd_info *master,
-                                     struct mtd_partition **pparts,
+                                     const struct mtd_partition **pparts,
                                      struct mtd_part_parser_data *data)
 {
        struct mtd_partition *parts;
index 11c3447eb8ff78555ac9d1c0780d14b79a8d73b1..7623ac5fc5865b83b108ca04c4ccad2bc1054290 100644 (file)
@@ -57,7 +57,7 @@ static inline int redboot_checksum(struct fis_image_desc *img)
 }
 
 static int parse_redboot_partitions(struct mtd_info *master,
-                                   struct mtd_partition **pparts,
+                                   const struct mtd_partition **pparts,
                                    struct mtd_part_parser_data *data)
 {
        int nrparts = 0;
index d002d9b5d79771e02d0dbc60609af3c7e8cb5d59..6185536daacc00490a8afd43f6c1672ecfc7575f 100644 (file)
@@ -69,7 +69,7 @@ struct mtd_part_parser {
        struct list_head list;
        struct module *owner;
        const char *name;
-       int (*parse_fn)(struct mtd_info *, struct mtd_partition **,
+       int (*parse_fn)(struct mtd_info *, const struct mtd_partition **,
                        struct mtd_part_parser_data *);
 };