]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/libfdt.h
mx6qsabrelite: Change default environment to cope with OE changes
[karo-tx-uboot.git] / include / libfdt.h
index 4589c5feb45033377fea72ab3885ca76808ba074..fc7f75b9ffa60b6bc23f44d39b59c4d0f4b7be3b 100644 (file)
@@ -882,8 +882,8 @@ int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
 static inline int fdt_setprop_inplace_u32(void *fdt, int nodeoffset,
                                          const char *name, uint32_t val)
 {
-       val = cpu_to_fdt32(val);
-       return fdt_setprop_inplace(fdt, nodeoffset, name, &val, sizeof(val));
+       fdt32_t tmp = cpu_to_fdt32(val);
+       return fdt_setprop_inplace(fdt, nodeoffset, name, &tmp, sizeof(tmp));
 }
 
 /**
@@ -917,8 +917,8 @@ static inline int fdt_setprop_inplace_u32(void *fdt, int nodeoffset,
 static inline int fdt_setprop_inplace_u64(void *fdt, int nodeoffset,
                                          const char *name, uint64_t val)
 {
-       val = cpu_to_fdt64(val);
-       return fdt_setprop_inplace(fdt, nodeoffset, name, &val, sizeof(val));
+       fdt64_t tmp = cpu_to_fdt64(val);
+       return fdt_setprop_inplace(fdt, nodeoffset, name, &tmp, sizeof(tmp));
 }
 
 /**
@@ -993,13 +993,13 @@ int fdt_begin_node(void *fdt, const char *name);
 int fdt_property(void *fdt, const char *name, const void *val, int len);
 static inline int fdt_property_u32(void *fdt, const char *name, uint32_t val)
 {
-       val = cpu_to_fdt32(val);
-       return fdt_property(fdt, name, &val, sizeof(val));
+       fdt32_t tmp = cpu_to_fdt32(val);
+       return fdt_property(fdt, name, &tmp, sizeof(tmp));
 }
 static inline int fdt_property_u64(void *fdt, const char *name, uint64_t val)
 {
-       val = cpu_to_fdt64(val);
-       return fdt_property(fdt, name, &val, sizeof(val));
+       fdt64_t tmp = cpu_to_fdt64(val);
+       return fdt_property(fdt, name, &tmp, sizeof(tmp));
 }
 static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
 {
@@ -1014,6 +1014,7 @@ int fdt_finish(void *fdt);
 /* Read-write functions                                               */
 /**********************************************************************/
 
+int fdt_create_empty_tree(void *buf, int bufsize);
 int fdt_open_into(const void *fdt, void *buf, int bufsize);
 int fdt_pack(void *fdt);
 
@@ -1153,8 +1154,8 @@ int fdt_setprop(void *fdt, int nodeoffset, const char *name,
 static inline int fdt_setprop_u32(void *fdt, int nodeoffset, const char *name,
                                  uint32_t val)
 {
-       val = cpu_to_fdt32(val);
-       return fdt_setprop(fdt, nodeoffset, name, &val, sizeof(val));
+       fdt32_t tmp = cpu_to_fdt32(val);
+       return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
 }
 
 /**
@@ -1188,8 +1189,8 @@ static inline int fdt_setprop_u32(void *fdt, int nodeoffset, const char *name,
 static inline int fdt_setprop_u64(void *fdt, int nodeoffset, const char *name,
                                  uint64_t val)
 {
-       val = cpu_to_fdt64(val);
-       return fdt_setprop(fdt, nodeoffset, name, &val, sizeof(val));
+       fdt64_t tmp = cpu_to_fdt64(val);
+       return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
 }
 
 /**
@@ -1295,8 +1296,8 @@ int fdt_appendprop(void *fdt, int nodeoffset, const char *name,
 static inline int fdt_appendprop_u32(void *fdt, int nodeoffset,
                                     const char *name, uint32_t val)
 {
-       val = cpu_to_fdt32(val);
-       return fdt_appendprop(fdt, nodeoffset, name, &val, sizeof(val));
+       fdt32_t tmp = cpu_to_fdt32(val);
+       return fdt_appendprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
 }
 
 /**
@@ -1330,8 +1331,8 @@ static inline int fdt_appendprop_u32(void *fdt, int nodeoffset,
 static inline int fdt_appendprop_u64(void *fdt, int nodeoffset,
                                     const char *name, uint64_t val)
 {
-       val = cpu_to_fdt64(val);
-       return fdt_appendprop(fdt, nodeoffset, name, &val, sizeof(val));
+       fdt64_t tmp = cpu_to_fdt64(val);
+       return fdt_appendprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
 }
 
 /**