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>
diff --git a/drivers/rtc/ds3232.c b/drivers/rtc/ds3232.c
index 09a106a..e3b3579 100644
--- a/drivers/rtc/ds3232.c
+++ b/drivers/rtc/ds3232.c
@@ -8,6 +8,7 @@
#include <dm.h>
#include <i2c.h>
#include <rtc.h>
+#include <dm/device_compat.h>
/*
* RTC register addresses
diff --git a/drivers/rtc/rv3029.c b/drivers/rtc/rv3029.c
index 2367062..87c4320 100644
--- a/drivers/rtc/rv3029.c
+++ b/drivers/rtc/rv3029.c
@@ -13,6 +13,7 @@
#include <eeprom.h>
#include <i2c.h>
#include <rtc.h>
+#include <dm/device_compat.h>
#define RTC_RV3029_PAGE_LEN 7
diff --git a/drivers/rtc/stm32_rtc.c b/drivers/rtc/stm32_rtc.c
index 2674714..3e12f57 100644
--- a/drivers/rtc/stm32_rtc.c
+++ b/drivers/rtc/stm32_rtc.c
@@ -5,8 +5,10 @@
#include <common.h>
#include <clk.h>
#include <dm.h>
+#include <malloc.h>
#include <rtc.h>
#include <asm/io.h>
+#include <dm/device_compat.h>
#include <linux/iopoll.h>
#define STM32_RTC_TR 0x00