kernel: update mtdsplit for linux 4.9
authorFelix Fietkau <nbd@nbd.name>
Wed, 1 Feb 2017 07:06:10 +0000 (08:06 +0100)
committerFelix Fietkau <nbd@nbd.name>
Fri, 3 Feb 2017 11:35:44 +0000 (12:35 +0100)
add backport patches for older kernels

Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 files changed:
target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_brnimage.c
target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_eva.c
target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c
target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_lzma.c
target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c
target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_squashfs.c
target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_tplink.c
target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_trx.c
target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c
target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_wrgg.c
target/linux/generic/patches-3.18/001-mtdsplit_backport.patch [new file with mode: 0644]
target/linux/generic/patches-4.4/001-mtdsplit_backport.patch [new file with mode: 0644]

index 1f4325ac9a44a37ca96956c4baee5a679d75a7a0..3f2d79601a1446e42f6f3cc448096f306bc29889 100644 (file)
@@ -27,7 +27,7 @@
 #define BRNIMAGE_MAX_OVERHEAD  (BRNIMAGE_ALIGN_BYTES + BRNIMAGE_FOOTER_SIZE)
 
 static int mtdsplit_parse_brnimage(struct mtd_info *master,
 #define BRNIMAGE_MAX_OVERHEAD  (BRNIMAGE_ALIGN_BYTES + BRNIMAGE_FOOTER_SIZE)
 
 static int mtdsplit_parse_brnimage(struct mtd_info *master,
-                               struct mtd_partition **pparts,
+                               const struct mtd_partition **pparts,
                                struct mtd_part_parser_data *data)
 {
        struct mtd_partition *parts;
                                struct mtd_part_parser_data *data)
 {
        struct mtd_partition *parts;
index 3edc104f4e901ac234356b73146d94ad40da7f8c..746944ee2e53635326826296bb504e89ddcfed47 100644 (file)
@@ -29,7 +29,7 @@ struct eva_image_header {
 };
 
 static int mtdsplit_parse_eva(struct mtd_info *master,
 };
 
 static int mtdsplit_parse_eva(struct mtd_info *master,
-                               struct mtd_partition **pparts,
+                               const struct mtd_partition **pparts,
                                struct mtd_part_parser_data *data)
 {
        struct mtd_partition *parts;
                                struct mtd_part_parser_data *data)
 {
        struct mtd_partition *parts;
index 57954061cdc7d07a6f1fd998db2ebc05bc09d663..f356adcd4e4eb19adf3b28530b9f66c88e5d8d78 100644 (file)
@@ -45,7 +45,8 @@ struct fdt_header {
 };
 
 static int
 };
 
 static int
-mtdsplit_fit_parse(struct mtd_info *mtd, struct mtd_partition **pparts,
+mtdsplit_fit_parse(struct mtd_info *mtd,
+                  const struct mtd_partition **pparts,
                   struct mtd_part_parser_data *data)
 {
        struct fdt_header hdr;
                   struct mtd_part_parser_data *data)
 {
        struct fdt_header hdr;
index f3d8c040c21b81e80f211234927e9a5594730f88..b7f044a6dc8246102ff6ae7f22f12cf645df1dea 100644 (file)
@@ -28,7 +28,7 @@ struct lzma_header {
 };
 
 static int mtdsplit_parse_lzma(struct mtd_info *master,
 };
 
 static int mtdsplit_parse_lzma(struct mtd_info *master,
-                              struct mtd_partition **pparts,
+                              const struct mtd_partition **pparts,
                               struct mtd_part_parser_data *data)
 {
        struct lzma_header hdr;
                               struct mtd_part_parser_data *data)
 {
        struct lzma_header hdr;
index 9fe131101882182e29779678958bd5f9d896a9ef..f8556e05a460f6e47ede3f3cf434c975dca11fc0 100644 (file)
@@ -30,7 +30,7 @@ struct seama_header {
 };
 
 static int mtdsplit_parse_seama(struct mtd_info *master,
 };
 
 static int mtdsplit_parse_seama(struct mtd_info *master,
-                               struct mtd_partition **pparts,
+                               const struct mtd_partition **pparts,
                                struct mtd_part_parser_data *data)
 {
        struct seama_header hdr;
                                struct mtd_part_parser_data *data)
 {
        struct seama_header hdr;
index 43b44d5642b6039b4c4c0a233b5cdfd600eb3d32..79e1f73bca15c7509d2d6023ab7458660be3d2ce 100644 (file)
@@ -23,7 +23,7 @@
 
 static int
 mtdsplit_parse_squashfs(struct mtd_info *master,
 
 static int
 mtdsplit_parse_squashfs(struct mtd_info *master,
-                       struct mtd_partition **pparts,
+                       const struct mtd_partition **pparts,
                        struct mtd_part_parser_data *data)
 {
        struct mtd_partition *part;
                        struct mtd_part_parser_data *data)
 {
        struct mtd_partition *part;
index d0cb381363da611c12a7481653b72631b2df3744..3a50250715bdec72918680cb87ea23592e1c8cdc 100644 (file)
@@ -83,8 +83,8 @@ struct tplink_fw_header {
 };
 
 static int mtdsplit_parse_tplink(struct mtd_info *master,
 };
 
 static int mtdsplit_parse_tplink(struct mtd_info *master,
-                               struct mtd_partition **pparts,
-                               struct mtd_part_parser_data *data)
+                                const struct mtd_partition **pparts,
+                                struct mtd_part_parser_data *data)
 {
        struct tplink_fw_header hdr;
        size_t hdr_len, retlen, kernel_size;
 {
        struct tplink_fw_header hdr;
        size_t hdr_len, retlen, kernel_size;
index 29f47b283e7e4db266bc227f9c167b363286aeaa..53aebc5987e88257261eb74a35d07bbd650a01cd 100644 (file)
@@ -56,7 +56,7 @@ read_trx_header(struct mtd_info *mtd, size_t offset,
 
 static int
 mtdsplit_parse_trx(struct mtd_info *master,
 
 static int
 mtdsplit_parse_trx(struct mtd_info *master,
-                  struct mtd_partition **pparts,
+                  const struct mtd_partition **pparts,
                   struct mtd_part_parser_data *data)
 {
        struct mtd_partition *parts;
                   struct mtd_part_parser_data *data)
 {
        struct mtd_partition *parts;
index 41a1b3746d6c94c9fe3b34a23269b37f6cfb0d03..ee65144fea283c612f4b95132d58b8ae7d336785 100644 (file)
@@ -81,7 +81,7 @@ read_uimage_header(struct mtd_info *mtd, size_t offset, u_char *buf,
  *      of a valid uImage header if found
  */
 static int __mtdsplit_parse_uimage(struct mtd_info *master,
  *      of a valid uImage header if found
  */
 static int __mtdsplit_parse_uimage(struct mtd_info *master,
-                                  struct mtd_partition **pparts,
+                                  const struct mtd_partition **pparts,
                                   struct mtd_part_parser_data *data,
                                   ssize_t (*find_header)(u_char *buf, size_t len))
 {
                                   struct mtd_part_parser_data *data,
                                   ssize_t (*find_header)(u_char *buf, size_t len))
 {
@@ -232,7 +232,7 @@ static ssize_t uimage_verify_default(u_char *buf, size_t len)
 
 static int
 mtdsplit_uimage_parse_generic(struct mtd_info *master,
 
 static int
 mtdsplit_uimage_parse_generic(struct mtd_info *master,
-                             struct mtd_partition **pparts,
+                             const struct mtd_partition **pparts,
                              struct mtd_part_parser_data *data)
 {
        return __mtdsplit_parse_uimage(master, pparts, data,
                              struct mtd_part_parser_data *data)
 {
        return __mtdsplit_parse_uimage(master, pparts, data,
@@ -289,7 +289,7 @@ static ssize_t uimage_verify_wndr3700(u_char *buf, size_t len)
 
 static int
 mtdsplit_uimage_parse_netgear(struct mtd_info *master,
 
 static int
 mtdsplit_uimage_parse_netgear(struct mtd_info *master,
-                             struct mtd_partition **pparts,
+                             const struct mtd_partition **pparts,
                              struct mtd_part_parser_data *data)
 {
        return __mtdsplit_parse_uimage(master, pparts, data,
                              struct mtd_part_parser_data *data)
 {
        return __mtdsplit_parse_uimage(master, pparts, data,
@@ -331,7 +331,7 @@ static ssize_t uimage_find_edimax(u_char *buf, size_t len)
 
 static int
 mtdsplit_uimage_parse_edimax(struct mtd_info *master,
 
 static int
 mtdsplit_uimage_parse_edimax(struct mtd_info *master,
-                             struct mtd_partition **pparts,
+                             const struct mtd_partition **pparts,
                              struct mtd_part_parser_data *data)
 {
        return __mtdsplit_parse_uimage(master, pparts, data,
                              struct mtd_part_parser_data *data)
 {
        return __mtdsplit_parse_uimage(master, pparts, data,
index c1fbccbd25d2299a4d3cdcc1a61b895d628bc94a..c0e897777df957503322fefcbecc429a10b3c425 100644 (file)
@@ -40,8 +40,8 @@ struct wrgg03_header {
 
 
 static int mtdsplit_parse_wrgg(struct mtd_info *master,
 
 
 static int mtdsplit_parse_wrgg(struct mtd_info *master,
-                               struct mtd_partition **pparts,
-                               struct mtd_part_parser_data *data)
+                              const struct mtd_partition **pparts,
+                              struct mtd_part_parser_data *data)
 {
        struct wrgg03_header hdr;
        size_t hdr_len, retlen, kernel_ent_size;
 {
        struct wrgg03_header hdr;
        size_t hdr_len, retlen, kernel_ent_size;
diff --git a/target/linux/generic/patches-3.18/001-mtdsplit_backport.patch b/target/linux/generic/patches-3.18/001-mtdsplit_backport.patch
new file mode 100644 (file)
index 0000000..97cd62d
--- /dev/null
@@ -0,0 +1,142 @@
+--- a/drivers/mtd/mtdsplit/mtdsplit_brnimage.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_brnimage.c
+@@ -27,7 +27,7 @@
+ #define BRNIMAGE_MAX_OVERHEAD (BRNIMAGE_ALIGN_BYTES + BRNIMAGE_FOOTER_SIZE)
+ static int mtdsplit_parse_brnimage(struct mtd_info *master,
+-                              const struct mtd_partition **pparts,
++                              struct mtd_partition **pparts,
+                               struct mtd_part_parser_data *data)
+ {
+       struct mtd_partition *parts;
+--- a/drivers/mtd/mtdsplit/mtdsplit_eva.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_eva.c
+@@ -29,7 +29,7 @@ struct eva_image_header {
+ };
+ static int mtdsplit_parse_eva(struct mtd_info *master,
+-                              const struct mtd_partition **pparts,
++                              struct mtd_partition **pparts,
+                               struct mtd_part_parser_data *data)
+ {
+       struct mtd_partition *parts;
+--- a/drivers/mtd/mtdsplit/mtdsplit_fit.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_fit.c
+@@ -45,8 +45,7 @@ struct fdt_header {
+ };
+ static int
+-mtdsplit_fit_parse(struct mtd_info *mtd,
+-                 const struct mtd_partition **pparts,
++mtdsplit_fit_parse(struct mtd_info *mtd, struct mtd_partition **pparts,
+                  struct mtd_part_parser_data *data)
+ {
+       struct fdt_header hdr;
+--- a/drivers/mtd/mtdsplit/mtdsplit_lzma.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_lzma.c
+@@ -28,7 +28,7 @@ struct lzma_header {
+ };
+ static int mtdsplit_parse_lzma(struct mtd_info *master,
+-                             const struct mtd_partition **pparts,
++                             struct mtd_partition **pparts,
+                              struct mtd_part_parser_data *data)
+ {
+       struct lzma_header hdr;
+--- a/drivers/mtd/mtdsplit/mtdsplit_seama.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_seama.c
+@@ -30,7 +30,7 @@ struct seama_header {
+ };
+ static int mtdsplit_parse_seama(struct mtd_info *master,
+-                              const struct mtd_partition **pparts,
++                              struct mtd_partition **pparts,
+                               struct mtd_part_parser_data *data)
+ {
+       struct seama_header hdr;
+--- a/drivers/mtd/mtdsplit/mtdsplit_squashfs.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_squashfs.c
+@@ -23,7 +23,7 @@
+ static int
+ mtdsplit_parse_squashfs(struct mtd_info *master,
+-                      const struct mtd_partition **pparts,
++                      struct mtd_partition **pparts,
+                       struct mtd_part_parser_data *data)
+ {
+       struct mtd_partition *part;
+--- a/drivers/mtd/mtdsplit/mtdsplit_tplink.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_tplink.c
+@@ -83,8 +83,8 @@ struct tplink_fw_header {
+ };
+ static int mtdsplit_parse_tplink(struct mtd_info *master,
+-                               const struct mtd_partition **pparts,
+-                               struct mtd_part_parser_data *data)
++                              struct mtd_partition **pparts,
++                              struct mtd_part_parser_data *data)
+ {
+       struct tplink_fw_header hdr;
+       size_t hdr_len, retlen, kernel_size;
+--- a/drivers/mtd/mtdsplit/mtdsplit_trx.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_trx.c
+@@ -56,7 +56,7 @@ read_trx_header(struct mtd_info *mtd, si
+ static int
+ mtdsplit_parse_trx(struct mtd_info *master,
+-                 const struct mtd_partition **pparts,
++                 struct mtd_partition **pparts,
+                  struct mtd_part_parser_data *data)
+ {
+       struct mtd_partition *parts;
+--- a/drivers/mtd/mtdsplit/mtdsplit_uimage.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_uimage.c
+@@ -81,7 +81,7 @@ read_uimage_header(struct mtd_info *mtd,
+  *      of a valid uImage header if found
+  */
+ static int __mtdsplit_parse_uimage(struct mtd_info *master,
+-                                 const struct mtd_partition **pparts,
++                                 struct mtd_partition **pparts,
+                                  struct mtd_part_parser_data *data,
+                                  ssize_t (*find_header)(u_char *buf, size_t len))
+ {
+@@ -232,7 +232,7 @@ static ssize_t uimage_verify_default(u_c
+ static int
+ mtdsplit_uimage_parse_generic(struct mtd_info *master,
+-                            const struct mtd_partition **pparts,
++                            struct mtd_partition **pparts,
+                             struct mtd_part_parser_data *data)
+ {
+       return __mtdsplit_parse_uimage(master, pparts, data,
+@@ -289,7 +289,7 @@ static ssize_t uimage_verify_wndr3700(u_
+ static int
+ mtdsplit_uimage_parse_netgear(struct mtd_info *master,
+-                            const struct mtd_partition **pparts,
++                            struct mtd_partition **pparts,
+                             struct mtd_part_parser_data *data)
+ {
+       return __mtdsplit_parse_uimage(master, pparts, data,
+@@ -331,7 +331,7 @@ static ssize_t uimage_find_edimax(u_char
+ static int
+ mtdsplit_uimage_parse_edimax(struct mtd_info *master,
+-                            const struct mtd_partition **pparts,
++                            struct mtd_partition **pparts,
+                             struct mtd_part_parser_data *data)
+ {
+       return __mtdsplit_parse_uimage(master, pparts, data,
+--- a/drivers/mtd/mtdsplit/mtdsplit_wrgg.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_wrgg.c
+@@ -40,8 +40,8 @@ struct wrgg03_header {
+ static int mtdsplit_parse_wrgg(struct mtd_info *master,
+-                             const struct mtd_partition **pparts,
+-                             struct mtd_part_parser_data *data)
++                              struct mtd_partition **pparts,
++                              struct mtd_part_parser_data *data)
+ {
+       struct wrgg03_header hdr;
+       size_t hdr_len, retlen, kernel_ent_size;
diff --git a/target/linux/generic/patches-4.4/001-mtdsplit_backport.patch b/target/linux/generic/patches-4.4/001-mtdsplit_backport.patch
new file mode 100644 (file)
index 0000000..97cd62d
--- /dev/null
@@ -0,0 +1,142 @@
+--- a/drivers/mtd/mtdsplit/mtdsplit_brnimage.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_brnimage.c
+@@ -27,7 +27,7 @@
+ #define BRNIMAGE_MAX_OVERHEAD (BRNIMAGE_ALIGN_BYTES + BRNIMAGE_FOOTER_SIZE)
+ static int mtdsplit_parse_brnimage(struct mtd_info *master,
+-                              const struct mtd_partition **pparts,
++                              struct mtd_partition **pparts,
+                               struct mtd_part_parser_data *data)
+ {
+       struct mtd_partition *parts;
+--- a/drivers/mtd/mtdsplit/mtdsplit_eva.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_eva.c
+@@ -29,7 +29,7 @@ struct eva_image_header {
+ };
+ static int mtdsplit_parse_eva(struct mtd_info *master,
+-                              const struct mtd_partition **pparts,
++                              struct mtd_partition **pparts,
+                               struct mtd_part_parser_data *data)
+ {
+       struct mtd_partition *parts;
+--- a/drivers/mtd/mtdsplit/mtdsplit_fit.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_fit.c
+@@ -45,8 +45,7 @@ struct fdt_header {
+ };
+ static int
+-mtdsplit_fit_parse(struct mtd_info *mtd,
+-                 const struct mtd_partition **pparts,
++mtdsplit_fit_parse(struct mtd_info *mtd, struct mtd_partition **pparts,
+                  struct mtd_part_parser_data *data)
+ {
+       struct fdt_header hdr;
+--- a/drivers/mtd/mtdsplit/mtdsplit_lzma.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_lzma.c
+@@ -28,7 +28,7 @@ struct lzma_header {
+ };
+ static int mtdsplit_parse_lzma(struct mtd_info *master,
+-                             const struct mtd_partition **pparts,
++                             struct mtd_partition **pparts,
+                              struct mtd_part_parser_data *data)
+ {
+       struct lzma_header hdr;
+--- a/drivers/mtd/mtdsplit/mtdsplit_seama.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_seama.c
+@@ -30,7 +30,7 @@ struct seama_header {
+ };
+ static int mtdsplit_parse_seama(struct mtd_info *master,
+-                              const struct mtd_partition **pparts,
++                              struct mtd_partition **pparts,
+                               struct mtd_part_parser_data *data)
+ {
+       struct seama_header hdr;
+--- a/drivers/mtd/mtdsplit/mtdsplit_squashfs.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_squashfs.c
+@@ -23,7 +23,7 @@
+ static int
+ mtdsplit_parse_squashfs(struct mtd_info *master,
+-                      const struct mtd_partition **pparts,
++                      struct mtd_partition **pparts,
+                       struct mtd_part_parser_data *data)
+ {
+       struct mtd_partition *part;
+--- a/drivers/mtd/mtdsplit/mtdsplit_tplink.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_tplink.c
+@@ -83,8 +83,8 @@ struct tplink_fw_header {
+ };
+ static int mtdsplit_parse_tplink(struct mtd_info *master,
+-                               const struct mtd_partition **pparts,
+-                               struct mtd_part_parser_data *data)
++                              struct mtd_partition **pparts,
++                              struct mtd_part_parser_data *data)
+ {
+       struct tplink_fw_header hdr;
+       size_t hdr_len, retlen, kernel_size;
+--- a/drivers/mtd/mtdsplit/mtdsplit_trx.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_trx.c
+@@ -56,7 +56,7 @@ read_trx_header(struct mtd_info *mtd, si
+ static int
+ mtdsplit_parse_trx(struct mtd_info *master,
+-                 const struct mtd_partition **pparts,
++                 struct mtd_partition **pparts,
+                  struct mtd_part_parser_data *data)
+ {
+       struct mtd_partition *parts;
+--- a/drivers/mtd/mtdsplit/mtdsplit_uimage.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_uimage.c
+@@ -81,7 +81,7 @@ read_uimage_header(struct mtd_info *mtd,
+  *      of a valid uImage header if found
+  */
+ static int __mtdsplit_parse_uimage(struct mtd_info *master,
+-                                 const struct mtd_partition **pparts,
++                                 struct mtd_partition **pparts,
+                                  struct mtd_part_parser_data *data,
+                                  ssize_t (*find_header)(u_char *buf, size_t len))
+ {
+@@ -232,7 +232,7 @@ static ssize_t uimage_verify_default(u_c
+ static int
+ mtdsplit_uimage_parse_generic(struct mtd_info *master,
+-                            const struct mtd_partition **pparts,
++                            struct mtd_partition **pparts,
+                             struct mtd_part_parser_data *data)
+ {
+       return __mtdsplit_parse_uimage(master, pparts, data,
+@@ -289,7 +289,7 @@ static ssize_t uimage_verify_wndr3700(u_
+ static int
+ mtdsplit_uimage_parse_netgear(struct mtd_info *master,
+-                            const struct mtd_partition **pparts,
++                            struct mtd_partition **pparts,
+                             struct mtd_part_parser_data *data)
+ {
+       return __mtdsplit_parse_uimage(master, pparts, data,
+@@ -331,7 +331,7 @@ static ssize_t uimage_find_edimax(u_char
+ static int
+ mtdsplit_uimage_parse_edimax(struct mtd_info *master,
+-                            const struct mtd_partition **pparts,
++                            struct mtd_partition **pparts,
+                             struct mtd_part_parser_data *data)
+ {
+       return __mtdsplit_parse_uimage(master, pparts, data,
+--- a/drivers/mtd/mtdsplit/mtdsplit_wrgg.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_wrgg.c
+@@ -40,8 +40,8 @@ struct wrgg03_header {
+ static int mtdsplit_parse_wrgg(struct mtd_info *master,
+-                             const struct mtd_partition **pparts,
+-                             struct mtd_part_parser_data *data)
++                              struct mtd_partition **pparts,
++                              struct mtd_part_parser_data *data)
+ {
+       struct wrgg03_header hdr;
+       size_t hdr_len, retlen, kernel_ent_size;