aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2015-05-13 10:33:56 -0400
committerRob Herring <robh@kernel.org>2015-05-28 14:00:25 -0400
commit3b1a2c97210b1edd1a999ff8c1f72ab28f7609f7 (patch)
tree80f16d5e2609d3260ef5fceeec7d31e143d454bf
parent3386e0fa905c31bf1dafa2cbe2ecceb7e5ce2e66 (diff)
of/fdt: Make fdt blob input parameters of unflatten functions const
Operations to unflatten fdt blobs never modify the input blobs, hence make them const. Now we no longer need to cast arbitrary const data to "void *" when calling of_fdt_unflatten_tree(). Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Rob Herring <robh@kernel.org>
-rw-r--r--drivers/of/fdt.c6
-rw-r--r--include/linux/of_fdt.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index cde35c5d0191..9628c4a77f76 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -168,7 +168,7 @@ static void *unflatten_dt_alloc(void **mem, unsigned long size,
168 * @dad: Parent struct device_node 168 * @dad: Parent struct device_node
169 * @fpsize: Size of the node path up at the current depth. 169 * @fpsize: Size of the node path up at the current depth.
170 */ 170 */
171static void * unflatten_dt_node(void *blob, 171static void * unflatten_dt_node(const void *blob,
172 void *mem, 172 void *mem,
173 int *poffset, 173 int *poffset,
174 struct device_node *dad, 174 struct device_node *dad,
@@ -378,7 +378,7 @@ static void * unflatten_dt_node(void *blob,
378 * @dt_alloc: An allocator that provides a virtual address to memory 378 * @dt_alloc: An allocator that provides a virtual address to memory
379 * for the resulting tree 379 * for the resulting tree
380 */ 380 */
381static void __unflatten_device_tree(void *blob, 381static void __unflatten_device_tree(const void *blob,
382 struct device_node **mynodes, 382 struct device_node **mynodes,
383 void * (*dt_alloc)(u64 size, u64 align)) 383 void * (*dt_alloc)(u64 size, u64 align))
384{ 384{
@@ -441,7 +441,7 @@ static void *kernel_tree_alloc(u64 size, u64 align)
441 * pointers of the nodes so the normal device-tree walking functions 441 * pointers of the nodes so the normal device-tree walking functions
442 * can be used. 442 * can be used.
443 */ 443 */
444void of_fdt_unflatten_tree(unsigned long *blob, 444void of_fdt_unflatten_tree(const unsigned long *blob,
445 struct device_node **mynodes) 445 struct device_node **mynodes)
446{ 446{
447 __unflatten_device_tree(blob, mynodes, &kernel_tree_alloc); 447 __unflatten_device_tree(blob, mynodes, &kernel_tree_alloc);
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index 587ee507965d..0cf217d404ce 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -37,7 +37,7 @@ extern bool of_fdt_is_big_endian(const void *blob,
37 unsigned long node); 37 unsigned long node);
38extern int of_fdt_match(const void *blob, unsigned long node, 38extern int of_fdt_match(const void *blob, unsigned long node,
39 const char *const *compat); 39 const char *const *compat);
40extern void of_fdt_unflatten_tree(unsigned long *blob, 40extern void of_fdt_unflatten_tree(const unsigned long *blob,
41 struct device_node **mynodes); 41 struct device_node **mynodes);
42 42
43/* TBD: Temporary export of fdt globals - remove when code fully merged */ 43/* TBD: Temporary export of fdt globals - remove when code fully merged */