kernel: rewrite run_parsers_by_type() to use add_mtd_partitions()
[openwrt/staging/rmilecki.git] / target / linux / generic / pending-4.14 / 404-mtd-add-more-helper-functions.patch
index c74a8670cb65b6b3212d76863558d294e3e03cd0..d1a32872af21c1c4ee763ab5bab549146a955f64 100644 (file)
@@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
 
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -1228,6 +1228,24 @@ int mtd_is_partition(const struct mtd_in
+@@ -1251,6 +1251,24 @@ int mtd_is_partition(const struct mtd_in
  }
  EXPORT_SYMBOL_GPL(mtd_is_partition);
  
@@ -38,7 +38,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  {
 --- a/include/linux/mtd/mtd.h
 +++ b/include/linux/mtd/mtd.h
-@@ -493,6 +493,24 @@ static inline uint32_t mtd_mod_by_eb(uin
+@@ -494,6 +494,24 @@ static inline uint32_t mtd_mod_by_eb(uin
        return do_div(sz, mtd->erasesize);
  }
  
@@ -65,12 +65,12 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
        if (mtd->writesize_shift)
 --- a/include/linux/mtd/partitions.h
 +++ b/include/linux/mtd/partitions.h
-@@ -115,6 +115,8 @@ int mtd_is_partition(const struct mtd_in
+@@ -116,6 +116,8 @@ int mtd_is_partition(const struct mtd_in
  int mtd_add_partition(struct mtd_info *master, const char *name,
                      long long offset, long long length);
  int mtd_del_partition(struct mtd_info *master, int partno);
 +struct mtd_info *mtdpart_get_master(const struct mtd_info *mtd);
 +uint64_t mtdpart_get_offset(const struct mtd_info *mtd);
  uint64_t mtd_get_device_size(const struct mtd_info *mtd);
- extern void __weak arch_split_mtd_part(struct mtd_info *master,
-                                      const char *name, int offset, int size);
+ #endif