summaryrefslogtreecommitdiff
path: root/drivers/mtd/ubi
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-02-03 17:36:16 +0300
committerSimon Glass <sjg@chromium.org>2020-02-06 05:33:46 +0300
commit336d4615f8fa774557d14f9b3245daa9e5fe3dbc (patch)
tree7a4d2d33113f44238d64e7e409fd3aafef63c2ed /drivers/mtd/ubi
parent61b29b82683863a970fd4609a7c58512872616bc (diff)
downloadu-boot-336d4615f8fa774557d14f9b3245daa9e5fe3dbc.tar.xz
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 'drivers/mtd/ubi')
-rw-r--r--drivers/mtd/ubi/debug.c1
-rw-r--r--drivers/mtd/ubi/misc.c1
-rw-r--r--drivers/mtd/ubi/upd.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/debug.c b/drivers/mtd/ubi/debug.c
index aec2613a09..d2b7ca5e33 100644
--- a/drivers/mtd/ubi/debug.c
+++ b/drivers/mtd/ubi/debug.c
@@ -6,6 +6,7 @@
*/
#include <hexdump.h>
+#include <malloc.h>
#include <ubi_uboot.h>
#include "ubi.h"
#ifndef __UBOOT__
diff --git a/drivers/mtd/ubi/misc.c b/drivers/mtd/ubi/misc.c
index 685324d7d2..3f7ee59c94 100644
--- a/drivers/mtd/ubi/misc.c
+++ b/drivers/mtd/ubi/misc.c
@@ -7,6 +7,7 @@
/* Here we keep miscellaneous functions which are used all over the UBI code */
+#include <malloc.h>
#include <ubi_uboot.h>
#include "ubi.h"
diff --git a/drivers/mtd/ubi/upd.c b/drivers/mtd/ubi/upd.c
index d0a6a1bd18..0f7951c859 100644
--- a/drivers/mtd/ubi/upd.c
+++ b/drivers/mtd/ubi/upd.c
@@ -26,6 +26,7 @@
*/
#ifndef __UBOOT__
+#include <malloc.h>
#include <linux/uaccess.h>
#else
#include <div64.h>