summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-02-03 07:36:16 -0700
committerSimon Glass <sjg@chromium.org>2020-02-05 19:33:46 -0700
commit336d4615f8fa774557d14f9b3245daa9e5fe3dbc (patch)
tree7a4d2d33113f44238d64e7e409fd3aafef63c2ed /common
parent61b29b82683863a970fd4609a7c58512872616bc (diff)
dm: core: Create a new header file for 'compat' features
At present dm/device.h includes the linux-compatible features. This requires including linux/compat.h which in turn includes a lot of headers. One of these is malloc.h which we thus end up including in every file in U-Boot. Apart from the inefficiency of this, it is problematic for sandbox which needs to use the system malloc() in some files. Move the compatibility features into a separate header file. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/android_ab.c1
-rw-r--r--common/autoboot.c1
-rw-r--r--common/image-fdt.c1
-rw-r--r--common/image.c1
-rw-r--r--common/usb.c1
-rw-r--r--common/usb_hub.c1
6 files changed, 6 insertions, 0 deletions
diff --git a/common/android_ab.c b/common/android_ab.c
index 6c4df419b2..e0fe32d24d 100644
--- a/common/android_ab.c
+++ b/common/android_ab.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <android_ab.h>
#include <android_bootloader_message.h>
+#include <malloc.h>
#include <linux/err.h>
#include <memalign.h>
#include <u-boot/crc.h>
diff --git a/common/autoboot.c b/common/autoboot.c
index 94a1b4abeb..4ea9be6da9 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -13,6 +13,7 @@
#include <env.h>
#include <fdtdec.h>
#include <hash.h>
+#include <malloc.h>
#include <memalign.h>
#include <menu.h>
#include <post.h>
diff --git a/common/image-fdt.c b/common/image-fdt.c
index dbe8535f9c..3002948b6b 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -14,6 +14,7 @@
#include <env.h>
#include <errno.h>
#include <image.h>
+#include <malloc.h>
#include <linux/libfdt.h>
#include <mapmem.h>
#include <asm/io.h>
diff --git a/common/image.c b/common/image.c
index 2288cff126..94873cb6ed 100644
--- a/common/image.c
+++ b/common/image.c
@@ -10,6 +10,7 @@
#include <common.h>
#include <cpu_func.h>
#include <env.h>
+#include <malloc.h>
#include <u-boot/crc.h>
#include <watchdog.h>
diff --git a/common/usb.c b/common/usb.c
index d9bcb5a57e..349e838f1d 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -28,6 +28,7 @@
#include <common.h>
#include <command.h>
#include <dm.h>
+#include <malloc.h>
#include <memalign.h>
#include <asm/processor.h>
#include <linux/compiler.h>
diff --git a/common/usb_hub.c b/common/usb_hub.c
index 25c2ac4345..c642b683e7 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -26,6 +26,7 @@
#include <dm.h>
#include <env.h>
#include <errno.h>
+#include <malloc.h>
#include <memalign.h>
#include <asm/processor.h>
#include <asm/unaligned.h>