Skip to content
This repository
Browse code

ARM: AM335x: Fix warning in timer.c

When compiling the kernel with configuration options ...

 # CONFIG_ARCH_OMAP2 is not set
 # CONFIG_ARCH_OMAP3 is not set
 # CONFIG_ARCH_OMAP4 is not set
 # CONFIG_SOC_OMAP5 is not set
 CONFIG_SOC_AM33XX=y

 ... the following build warning is seen.

  CC      arch/arm/mach-omap2/timer.o
  arch/arm/mach-omap2/timer.c:395:19: warning: ‘omap2_sync32k_clocksource_init’
  	defined but not used [-Wunused-function]

This issue was introduced by commit 6f80b3b (ARM: OMAP2+: timer: remove
CONFIG_OMAP_32K_TIMER) where the omap2_sync32k_clocksource_init() is no
longer referenced by the timer initialisation function for the AM335x
device as it has no 32k-sync timer.

Fix this by only including the omap2_sync32k_clocksource_init() function
if either OMAP2, OMAP3, OMAP4 or OMAP5 devices are enabled.

Cc: Igor Grinberg <grinberg@compulab.co.il>

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
  • Loading branch information...
commit b352aec2c3f1f6c6ebe4f38e3711b3c3cfe85705 1 parent 1070685
Jon Hunter authored hvaibhav committed

Showing 1 changed file with 3 additions and 0 deletions. Show diff stats Hide diff stats

  1. 3  arch/arm/mach-omap2/timer.c
3  arch/arm/mach-omap2/timer.c
@@ -386,6 +386,8 @@ static u32 notrace dmtimer_read_sched_clock(void)
386 386
 	return 0;
387 387
 }
388 388
 
  389
+#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
  390
+	defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
389 391
 static struct of_device_id omap_counter_match[] __initdata = {
390 392
 	{ .compatible = "ti,omap-counter32k", },
391 393
 	{ }
@@ -451,6 +453,7 @@ static int __init omap2_sync32k_clocksource_init(void)
451 453
 
452 454
 	return ret;
453 455
 }
  456
+#endif
454 457
 
455 458
 static void __init omap2_gptimer_clocksource_init(int gptimer_id,
456 459
 						const char *fck_source)

0 notes on commit b352aec

Please sign in to comment.
Something went wrong with that request. Please try again.