xtensa: fix !CONFIG_XTENSA_CALIBRATE_CCOUNT build failure
authorBaruch Siach <baruch@tkos.co.il>
Mon, 15 Jul 2013 04:03:38 +0000 (07:03 +0300)
committerChris Zankel <chris@zankel.net>
Fri, 6 Sep 2013 16:48:51 +0000 (09:48 -0700)
Commits 925f5532 (xtensa: ccount based clockevent implementation) and e3f43291
(xtensa: ccount based sched_clock) introduced users of ccount_freq. This
variable doesn't exist when CONFIG_XTENSA_CALIBRATE_CCOUNT is disabled. Add
ccount_freq definition in this case.

Reported-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
arch/xtensa/include/asm/timex.h
arch/xtensa/kernel/time.c

index 69f901713fb6fd754301d35372eaf2f54a543c7f..86aca77339f207636bc9f562f765b5ccd580b967 100644 (file)
 # error "Bad timer number for Linux configurations!"
 #endif
 
-#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
 extern unsigned long ccount_freq;
 #define CCOUNT_PER_JIFFY (ccount_freq / HZ)
-#else
-#define CCOUNT_PER_JIFFY (CONFIG_XTENSA_CPU_CLOCK*(1000000UL/HZ))
-#endif
-
 
 typedef unsigned long long cycles_t;
 
index 24bb0c1776ba860fb03a72b94e0107ac8bcfe1f1..a65cb3808e1c5f8759a0b9a66b4bd645e098140b 100644 (file)
@@ -29,9 +29,7 @@
 #include <asm/timex.h>
 #include <asm/platform.h>
 
-#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
 unsigned long ccount_freq;             /* ccount Hz */
-#endif
 
 static cycle_t ccount_read(struct clocksource *cs)
 {
@@ -129,6 +127,8 @@ void __init time_init(void)
        platform_calibrate_ccount();
        printk("%d.%02d MHz\n", (int)ccount_freq/1000000,
                        (int)(ccount_freq/10000)%100);
+#else
+       ccount_freq = CONFIG_XTENSA_CPU_CLOCK*1000000UL;
 #endif
        clocksource_register_hz(&ccount_clocksource, CCOUNT_PER_JIFFY * HZ);