rtc: compile date.c if DM_RTC
rtc_to_tm() and rtc_mktime() are required for some RTC drivers, at least
PL031. Without this patch, we also need to enable CONFIG_CMD_DATE even if
we don't want or need this command.
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
diff --git a/drivers/rtc/date.c b/drivers/rtc/date.c
index f2568cf..c57317d 100644
--- a/drivers/rtc/date.c
+++ b/drivers/rtc/date.c
@@ -9,7 +9,8 @@
#include <errno.h>
#include <rtc.h>
-#if defined(CONFIG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
+#if defined(CONFIG_CMD_DATE) || defined(CONFIG_DM_RTC) || \
+ defined(CONFIG_TIMESTAMP)
#define FEBRUARY 2
#define STARTOFTIME 1970