efi: include libfdt header only for aarch64 and riscv
For x86, preprocessor fails to locate headers included by lib/libfdt.h
as they are missing from the include path.
Fixes: 9632ce446b8f ("arm64: efi: Improve device tree discovery")
Signed-off-by: Vasant Karasulli <vkarasulli@suse.de>
Signed-off-by: Andrew Jones <andrew.jones@linux.dev>
diff --git a/lib/efi.c b/lib/efi.c
index 4433783..f396bd7 100644
--- a/lib/efi.c
+++ b/lib/efi.c
@@ -12,7 +12,6 @@
#include <stdlib.h>
#include <asm/setup.h>
#include "efi.h"
-#include "libfdt/libfdt.h"
/* From each arch */
extern char *initrd;
@@ -205,6 +204,7 @@
}
#if defined(__aarch64__) || defined(__riscv)
+#include "libfdt/libfdt.h"
/*
* Open the file and read it into a buffer.
*/