ARM: imx: build cpu_is_imx6sl function conditionally
authorArnd Bergmann <arnd@arndb.de>
Thu, 3 Jul 2014 14:22:54 +0000 (16:22 +0200)
committerShawn Guo <shawn.guo@freescale.com>
Fri, 18 Jul 2014 08:11:36 +0000 (16:11 +0800)
imx6q_pm_enter calls imx6sl_set_wait_clk when run on an imx6sl
based machine. However if support for imx6sl is not enabled
at compile time, this prevents us from building the kernel and
we get this link error instead:

arch/arm/mach-imx/built-in.o: In function `imx6q_pm_enter':
:(.text+0x4b84): undefined reference to `imx6sl_set_wait_clk'

This makes the cpu_is_imx6sl function conditionally return false
if imx6sl is disabled at compile-time, which matches what the
older cpu_is_mx* macros did. We have similar inline functions for
the other imx6 variants, but so far I have not run into a case
where the extra #ifdef is necessary.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
arch/arm/mach-imx/mxc.h

index 75d6a37e1ae490f3603ac84b19369f6d3204a139..a39b69ef43019ff0460aaa7012c63d466d48f39a 100644 (file)
@@ -154,10 +154,17 @@ extern unsigned int __mxc_cpu_type;
 #endif
 
 #ifndef __ASSEMBLY__
+#ifdef CONFIG_SOC_IMX6SL
 static inline bool cpu_is_imx6sl(void)
 {
        return __mxc_cpu_type == MXC_CPU_IMX6SL;
 }
+#else
+static inline bool cpu_is_imx6sl(void)
+{
+       return false;
+}
+#endif
 
 static inline bool cpu_is_imx6dl(void)
 {