Merge tag 'v3.14.25' into backport/v3.14.24-ltsi-rc1+v3.14.25/snapshot-merge.wip
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / of / fdt.c
index 758b4f8..9218d45 100644 (file)
@@ -38,7 +38,7 @@ char *of_fdt_get_string(struct boot_param_header *blob, u32 offset)
  */
 void *of_fdt_get_property(struct boot_param_header *blob,
                       unsigned long node, const char *name,
-                      unsigned long *size)
+                      int *size)
 {
        unsigned long p = node;
 
@@ -88,7 +88,8 @@ int of_fdt_is_compatible(struct boot_param_header *blob,
                      unsigned long node, const char *compat)
 {
        const char *cp;
-       unsigned long cplen, l, score = 0;
+       int cplen;
+       unsigned long l, score = 0;
 
        cp = of_fdt_get_property(blob, node, "compatible", &cplen);
        if (cp == NULL)
@@ -518,8 +519,8 @@ unsigned long __init of_get_flat_dt_root(void)
  * This function can be used within scan_flattened_dt callback to get
  * access to properties
  */
-void *__init of_get_flat_dt_prop(unsigned long node, const char *name,
-                                unsigned long *size)
+const void *__init of_get_flat_dt_prop(unsigned long node, const char *name,
+                                      int *size)
 {
        return of_fdt_get_property(initial_boot_params, node, name, size);
 }
@@ -657,7 +658,7 @@ const void * __init of_flat_dt_match_machine(const void *default_match,
        }
        if (!best_data) {
                const char *prop;
-               long size;
+               int size;
 
                pr_err("\n unrecognized device tree list:\n[ ");
 
@@ -686,8 +687,8 @@ const void * __init of_flat_dt_match_machine(const void *default_match,
 static void __init early_init_dt_check_for_initrd(unsigned long node)
 {
        u64 start, end;
-       unsigned long len;
-       __be32 *prop;
+       int len;
+       const __be32 *prop;
 
        pr_debug("Looking for initrd properties... ");
 
@@ -720,7 +721,7 @@ static inline void early_init_dt_check_for_initrd(unsigned long node)
 int __init early_init_dt_scan_root(unsigned long node, const char *uname,
                                   int depth, void *data)
 {
-       __be32 *prop;
+       const __be32 *prop;
 
        if (depth != 0)
                return 0;
@@ -742,9 +743,9 @@ int __init early_init_dt_scan_root(unsigned long node, const char *uname,
        return 1;
 }
 
-u64 __init dt_mem_next_cell(int s, __be32 **cellp)
+u64 __init dt_mem_next_cell(int s, const __be32 **cellp)
 {
-       __be32 *p = *cellp;
+       const __be32 *p = *cellp;
 
        *cellp = p + s;
        return of_read_number(p, s);
@@ -756,9 +757,9 @@ u64 __init dt_mem_next_cell(int s, __be32 **cellp)
 int __init early_init_dt_scan_memory(unsigned long node, const char *uname,
                                     int depth, void *data)
 {
-       char *type = of_get_flat_dt_prop(node, "device_type", NULL);
-       __be32 *reg, *endp;
-       unsigned long l;
+       const char *type = of_get_flat_dt_prop(node, "device_type", NULL);
+       const __be32 *reg, *endp;
+       int l;
 
        /* We are scanning "memory" nodes only */
        if (type == NULL) {
@@ -779,7 +780,7 @@ int __init early_init_dt_scan_memory(unsigned long node, const char *uname,
 
        endp = reg + (l / sizeof(__be32));
 
-       pr_debug("memory scan node %s, reg size %ld, data: %x %x %x %x,\n",
+       pr_debug("memory scan node %s, reg size %d, data: %x %x %x %x,\n",
            uname, l, reg[0], reg[1], reg[2], reg[3]);
 
        while ((endp - reg) >= (dt_root_addr_cells + dt_root_size_cells)) {
@@ -802,8 +803,8 @@ int __init early_init_dt_scan_memory(unsigned long node, const char *uname,
 int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
                                     int depth, void *data)
 {
-       unsigned long l;
-       char *p;
+       int l;
+       const char *p;
 
        pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname);