[U-Boot,v3,1/3] rtc: compile date.c if DM_RTC

Message ID 20180711090608.11526-2-takahiro.akashi@linaro.org
State Accepted
Commit 8cffb50ab3f1a9a9f28e8f44ffc93a79c7c25ed9
Delegated to: Tom Rini
Headers show
Series
  • subject: arm: qemu-arm: enable PL031 (RTC)
Related show

Commit Message

Akashi, Takahiro July 11, 2018, 9:06 a.m.
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>
---
 drivers/rtc/date.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Heinrich Schuchardt July 11, 2018, 10:35 a.m. | #1
On 07/11/2018 11:06 AM, AKASHI Takahiro wrote:
> 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>
Tom Rini July 26, 2018, 7:53 p.m. | #2
On Wed, Jul 11, 2018 at 06:06:06PM +0900, AKASHI Takahiro wrote:

> 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>

Applied to u-boot/master, thanks!

Patch

diff --git a/drivers/rtc/date.c b/drivers/rtc/date.c
index 1256ffe374..f1ac738a8a 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