Skip to contentSkip to conversation

lib: time: update module enable MACRO

PATCH In review Kever Yang 3 participants 3 messages Mar 29, 2019 Library code

lore
Share & tools
lore

Kever Yang

author
#0 lore raw

PATCH 1/1 lib: time: update module enable MACRO

We'd better use correct way to check if module has enabled. for we have 3 timer MACRO:
- CONFIG_TIMER
- CONFIG_SPL_TIMER
- CONFIG_TPL_TIMER

---

 lib/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/time.c +1 -1
index 3bf678a232..9c55da6f1b 100644
@@ -56,7 +56,7 @@ ulong timer_get_boot_us(void)
 extern unsigned long __weak timer_read_counter(void);
 #endif
 
-#ifdef CONFIG_TIMER
+#if CONFIG_IS_ENABLED(TIMER)
 ulong notrace get_tbclk(void)
 {
 	if (!gd->timer) {
Signature · 1 line
2.20.1
#2 lore raw
In reply to Kever Yang
Quoted 8 lines · Kever Yang

We'd better use correct way to check if module has enabled. for we have 3 timer MACRO:
- CONFIG_TIMER
- CONFIG_SPL_TIMER
- CONFIG_TPL_TIMER

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190329/83167ad6/attachment.sig>