arm64: psci: Fix build breakage without PM_SLEEP
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>
Tue, 9 Dec 2014 11:48:36 +0000 (11:48 +0000)
committerWill Deacon <will.deacon@arm.com>
Thu, 11 Dec 2014 12:08:06 +0000 (12:08 +0000)
Fix build failure of defconfig when PM_SLEEP is disabled (e.g. by
disabling SUSPEND) and CPU_IDLE enabled:

arch/arm64/kernel/psci.c:543:2: error: unknown field ‘cpu_suspend’ specified in initializer
  .cpu_suspend = cpu_psci_cpu_suspend,
  ^
arch/arm64/kernel/psci.c:543:2: warning: initialization from incompatible pointer type [enabled by default]
arch/arm64/kernel/psci.c:543:2: warning: (near initialization for ‘cpu_psci_ops.cpu_prepare’) [enabled by default]
make[1]: *** [arch/arm64/kernel/psci.o] Error 1

The cpu_operations.cpu_suspend field exists only if ARM64_CPU_SUSPEND is
defined, not CPU_IDLE.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/psci.c

index 866c1c821860d9689dc363b73001529ee3b5bec5..b38c82791f80e4df6055c055aa87872cbcf20615 100644 (file)
@@ -540,6 +540,8 @@ const struct cpu_operations cpu_psci_ops = {
        .name           = "psci",
 #ifdef CONFIG_CPU_IDLE
        .cpu_init_idle  = cpu_psci_cpu_init_idle,
+#endif
+#ifdef CONFIG_ARM64_CPU_SUSPEND
        .cpu_suspend    = cpu_psci_cpu_suspend,
 #endif
 #ifdef CONFIG_SMP