kernel: remove upstreamed patch from 4.19
[oweals/openwrt.git] / target / linux / generic / pending-4.14 / 161-mtd-part-add-generic-parsing-of-linux-part-probe.patch
index 0e858d93bba85a49826268aa6207a018d0502948..9625a51129cfcd4d52293f3e1f7284ed30e38536 100644 (file)
@@ -6,6 +6,12 @@ physmap_of.c to mtdpart.c. Now all drivers can use this feature by just
 providing a reference to their device tree node in struct
 mtd_part_parser_data.
 
+THIS METHOD HAS BEEN DEPRECATED
+
+Linux supports "compatible" property in the "partitions" subnode now. It
+should be used to specify partitions format (and trigger proper parser
+usage) if needed.
+
 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
 ---
  Documentation/devicetree/bindings/mtd/nand.txt | 16 +++++++++
@@ -104,10 +110,13 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  #include <linux/err.h>
  #include <linux/of.h>
  
-@@ -851,6 +852,32 @@ void deregister_mtd_parser(struct mtd_pa
+@@ -844,6 +845,37 @@ void deregister_mtd_parser(struct mtd_pa
+ }
  EXPORT_SYMBOL_GPL(deregister_mtd_parser);
  
- /*
++#include <linux/version.h>
++
++/*
 + * Parses the linux,part-probe device tree property.
 + * When a non null value is returned it has to be freed with kfree() by
 + * the caller.
@@ -130,14 +139,16 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
 +      if (count < 0)
 +              return NULL;
 +
++      pr_warn("Support for the generic \"linux,part-probe\" has been deprecated and will be removed soon");
++      BUILD_BUG_ON(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0));
++
 +      return res;
 +}
 +
-+/*
+ /*
   * Do not forget to update 'parse_mtd_partitions()' kerneldoc comment if you
   * are changing this array!
-  */
-@@ -991,6 +1018,13 @@ int parse_mtd_partitions(struct mtd_info
+@@ -993,6 +1025,13 @@ int parse_mtd_partitions(struct mtd_info
        struct mtd_partitions pparts = { };
        struct mtd_part_parser *parser;
        int ret, err = 0;
@@ -150,8 +161,8 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
 +      }
  
        if (!types)
-               types = default_mtd_part_types;
-@@ -1031,6 +1065,7 @@ int parse_mtd_partitions(struct mtd_info
+               types = mtd_is_partition(master) ? default_subpartition_types :
+@@ -1034,6 +1073,7 @@ int parse_mtd_partitions(struct mtd_info
                if (ret < 0 && !err)
                        err = ret;
        }