From: Gerald Van Baren Date: Sun, 19 Oct 2008 22:50:07 -0400 Subject: [PATCH] libfdt: Use endian.h instead of asm/byteorder.h Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Using asm/byteorder.h directly is strongly discouraged since it is a private kernel header. Signed-off-by: Gerald Van Baren --- include/libfdt_env.h | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/include/libfdt_env.h b/include/libfdt_env.h index 671c3a8..728a248 100644 --- a/include/libfdt_env.h +++ b/include/libfdt_env.h @@ -33,10 +33,17 @@ #include extern struct fdt_header *working_fdt; /* Pointer to the working fdt */ -#define fdt32_to_cpu(x) __be32_to_cpu(x) -#define cpu_to_fdt32(x) __cpu_to_be32(x) -#define fdt64_to_cpu(x) __be64_to_cpu(x) -#define cpu_to_fdt64(x) __cpu_to_be64(x) +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define fdt32_to_cpu(x) __swab32(x) +#define cpu_to_fdt32(x) __swab32(x) +#define fdt64_to_cpu(x) __swab64(x) +#define cpu_to_fdt64(x) __swab64(x) +#else +#define fdt32_to_cpu(x) (x) +#define cpu_to_fdt32(x) (x) +#define fdt64_to_cpu(x) (x) +#define cpu_to_fdt64(x) (x) +#endif /* * Types for `void *' pointers. -- 1.5.6.5