kernel: move old firmware uimage splitter into separated patch
[openwrt.git] / target / linux / generic / patches-3.14 / 405-mtd-add-more-helper-functions.patch
index 30292e9..f3f957b 100644 (file)
        }
        if (slave->offset == MTDPART_OFS_RETAIN) {
                slave->offset = cur_offset;
-@@ -944,6 +942,24 @@ int mtd_is_partition(const struct mtd_in
+@@ -659,6 +657,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
+@@ -900,6 +909,24 @@ int mtd_is_partition(const struct mtd_in
  }
  EXPORT_SYMBOL_GPL(mtd_is_partition);