kernel: bump 4.14 to 4.14.158
[openwrt/openwrt.git] / target / linux / generic / pending-4.14 / 404-mtd-add-more-helper-functions.patch
index 9b2fcac93d0dbe3e0143ba0d9f8dc29a3ab5c25a..7b481ffb47a57980feb215a6afa56381e734017a 100644 (file)
@@ -11,25 +11,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
 
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -800,6 +800,17 @@ run_parsers_by_type(struct mtd_part *sla
-       return nr_parts;
- }
-+static inline unsigned long
-+mtd_pad_erasesize(struct mtd_info *mtd, int offset, int len)
-+{
-+      unsigned long mask = mtd->erasesize - 1;
-+
-+      len += offset & mask;
-+      len = (len + mask) & ~mask;
-+      len -= offset & mask;
-+      return len;
-+}
-+
- #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME
- #define SPLIT_FIRMWARE_NAME   CONFIG_MTD_SPLIT_FIRMWARE_NAME
- #else
-@@ -1242,6 +1253,24 @@ int mtd_is_partition(const struct mtd_in
+@@ -1260,6 +1260,24 @@ int mtd_is_partition(const struct mtd_in
  }
  EXPORT_SYMBOL_GPL(mtd_is_partition);
  
@@ -56,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);
  }
  
@@ -83,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