diff mbox

ARM: OMAP2+: Fix undefined reference to set_cntfreq

Message ID 20131118232145.GX10317@atomide.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tony Lindgren Nov. 18, 2013, 11:21 p.m. UTC
* Santosh Shilimkar <santosh.shilimkar@ti.com> [131118 15:11]:
> On Monday 18 November 2013 04:58 PM, Tony Lindgren wrote:
> > If CONFIG_SOC_HAS_REALTIME_COUNTER is not selected for omap5
> > or dra7xx, we can get the following error:
> > 
> > arch/arm/mach-omap2/built-in.o: In function `omap4_secondary_init':
> > :(.text+0x7ab0): undefined reference to `set_cntfreq'
> > 
> > Fix the issue by not trying to initalize the realtime counter
> > unles CONFIG_SOC_HAS_REALTIME_COUNTER is selected.
> > 
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> >
> How about a dummy inline function of set_cntfreq() ?
> Having #ifdef in middle of the code looks pretty ugly.

Sure, here's an updated version.

Tony


From: Tony Lindgren <tony@atomide.com>
Date: Mon, 18 Nov 2013 13:56:48 -0800
Subject: [PATCH] ARM: OMAP2+: Fix undefined reference to set_cntfreq

If CONFIG_SOC_HAS_REALTIME_COUNTER is not selected for omap5
or dra7xx, we can get the following error:

arch/arm/mach-omap2/built-in.o: In function `omap4_secondary_init':
:(.text+0x7ab0): undefined reference to `set_cntfreq'

Fix the issue by not trying to initalize the realtime counter
unles CONFIG_SOC_HAS_REALTIME_COUNTER is selected.

Signed-off-by: Tony Lindgren <tony@atomide.com>

Comments

Santosh Shilimkar Nov. 19, 2013, 12:04 a.m. UTC | #1
On Monday 18 November 2013 06:21 PM, Tony Lindgren wrote:
> * Santosh Shilimkar <santosh.shilimkar@ti.com> [131118 15:11]:
>> On Monday 18 November 2013 04:58 PM, Tony Lindgren wrote:
>>> If CONFIG_SOC_HAS_REALTIME_COUNTER is not selected for omap5
>>> or dra7xx, we can get the following error:
>>>
>>> arch/arm/mach-omap2/built-in.o: In function `omap4_secondary_init':
>>> :(.text+0x7ab0): undefined reference to `set_cntfreq'
>>>
>>> Fix the issue by not trying to initalize the realtime counter
>>> unles CONFIG_SOC_HAS_REALTIME_COUNTER is selected.
>>>
>>> Signed-off-by: Tony Lindgren <tony@atomide.com>
>>>
>> How about a dummy inline function of set_cntfreq() ?
>> Having #ifdef in middle of the code looks pretty ugly.
> 
> Sure, here's an updated version.
> 
Thanks for quick spin.

> 
> 
> From: Tony Lindgren <tony@atomide.com>
> Date: Mon, 18 Nov 2013 13:56:48 -0800
> Subject: [PATCH] ARM: OMAP2+: Fix undefined reference to set_cntfreq
> 
> If CONFIG_SOC_HAS_REALTIME_COUNTER is not selected for omap5
> or dra7xx, we can get the following error:
> 
> arch/arm/mach-omap2/built-in.o: In function `omap4_secondary_init':
> :(.text+0x7ab0): undefined reference to `set_cntfreq'
> 
> Fix the issue by not trying to initalize the realtime counter
> unles CONFIG_SOC_HAS_REALTIME_COUNTER is selected.
> 
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> 
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
diff mbox

Patch

--- a/arch/arm/mach-omap2/omap-secure.h
+++ b/arch/arm/mach-omap2/omap-secure.h
@@ -76,6 +76,13 @@  static inline void omap_barrier_reserve_memblock(void)
 { }
 #endif
 
+#ifdef CONFIG_SOC_HAS_REALTIME_COUNTER
 void set_cntfreq(void);
+#else
+static inline void set_cntfreq(void)
+{
+}
+#endif
+
 #endif /* __ASSEMBLER__ */
 #endif /* OMAP_ARCH_OMAP_SECURE_H */