OpenWrt – Diff between revs 2 and 3

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 2 Rev 3
Line 4... Line 4...
4 This moves the linux,part-probe device tree parsing code from 4 This moves the linux,part-probe device tree parsing code from
5 physmap_of.c to mtdpart.c. Now all drivers can use this feature by just 5 physmap_of.c to mtdpart.c. Now all drivers can use this feature by just
6 providing a reference to their device tree node in struct 6 providing a reference to their device tree node in struct
7 mtd_part_parser_data. 7 mtd_part_parser_data.
Line 8... Line -...
8   -  
9 THIS METHOD HAS BEEN DEPRECATED -  
10   -  
11 Linux supports "compatible" property in the "partitions" subnode now. It -  
12 should be used to specify partitions format (and trigger proper parser -  
13 usage) if needed. -  
14   8  
15 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> 9 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
16 --- 10 ---
17 Documentation/devicetree/bindings/mtd/nand.txt | 16 +++++++++ 11 Documentation/devicetree/bindings/mtd/nand.txt | 16 +++++++++
18 drivers/mtd/maps/physmap_of.c | 46 +------------------------- 12 drivers/mtd/maps/physmap_of.c | 46 +-------------------------
Line 108... Line 102...
108 #include <linux/mtd/partitions.h> 102 #include <linux/mtd/partitions.h>
109 +#include <linux/of.h> 103 +#include <linux/of.h>
110 #include <linux/err.h> 104 #include <linux/err.h>
111 #include <linux/of.h> 105 #include <linux/of.h>
Line 112... Line 106...
112 106
113 @@ -844,6 +845,37 @@ void deregister_mtd_parser(struct mtd_pa -  
114 } 107 @@ -835,6 +836,32 @@ void deregister_mtd_parser(struct mtd_pa
Line 115... Line -...
115 EXPORT_SYMBOL_GPL(deregister_mtd_parser); -  
116 -  
117 +#include <linux/version.h> 108 EXPORT_SYMBOL_GPL(deregister_mtd_parser);
118 + 109
119 +/* 110 /*
120 + * Parses the linux,part-probe device tree property. 111 + * Parses the linux,part-probe device tree property.
121 + * When a non null value is returned it has to be freed with kfree() by 112 + * When a non null value is returned it has to be freed with kfree() by
122 + * the caller. 113 + * the caller.
Line 137... Line 128...
137 + count = of_property_read_string_array(dp, "linux,part-probe", res, 128 + count = of_property_read_string_array(dp, "linux,part-probe", res,
138 + count); 129 + count);
139 + if (count < 0) 130 + if (count < 0)
140 + return NULL; 131 + return NULL;
141 + 132 +
142 + pr_warn("Support for the generic \"linux,part-probe\" has been deprecated and will be removed soon"); -  
143 + BUILD_BUG_ON(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)); -  
144 + -  
145 + return res; 133 + return res;
146 +} 134 +}
147 + 135 +
148 /* 136 +/*
149 * Do not forget to update 'parse_mtd_partitions()' kerneldoc comment if you 137 * Do not forget to update 'parse_mtd_partitions()' kerneldoc comment if you
150 * are changing this array! 138 * are changing this array!
-   139 */
151 @@ -993,6 +1025,13 @@ int parse_mtd_partitions(struct mtd_info 140 @@ -983,6 +1010,13 @@ int parse_mtd_partitions(struct mtd_info
152 struct mtd_partitions pparts = { }; 141 struct mtd_partitions pparts = { };
153 struct mtd_part_parser *parser; 142 struct mtd_part_parser *parser;
154 int ret, err = 0; 143 int ret, err = 0;
155 + const char *const *types_of = NULL; 144 + const char *const *types_of = NULL;
156 + 145 +
Line 160... Line 149...
160 + types = types_of; 149 + types = types_of;
161 + } 150 + }
Line 162... Line 151...
162 151
163 if (!types) 152 if (!types)
164 types = mtd_is_partition(master) ? default_subpartition_types : 153 types = mtd_is_partition(master) ? default_subpartition_types :
165 @@ -1034,6 +1073,7 @@ int parse_mtd_partitions(struct mtd_info 154 @@ -1024,6 +1058,7 @@ int parse_mtd_partitions(struct mtd_info
166 if (ret < 0 && !err) 155 if (ret < 0 && !err)
167 err = ret; 156 err = ret;
168 } 157 }
169 + kfree(types_of); 158 + kfree(types_of);