Skip to content

Commit 1cf6248

Browse files
committed
LoongArch: Fix build error if CONFIG_SUSPEND is not set
We can see the following build error on LoongArch if CONFIG_SUSPEND is not set: ld: drivers/acpi/sleep.o: in function 'acpi_pm_prepare': sleep.c:(.text+0x2b8): undefined reference to 'loongarch_wakeup_start' Here is the call trace: acpi_pm_prepare() __acpi_pm_prepare() acpi_sleep_prepare() acpi_get_wakeup_address() loongarch_wakeup_start() Root cause: loongarch_wakeup_start() is defined in arch/loongarch/power/ suspend_asm.S which is only built under CONFIG_SUSPEND. In order to fix the build error, just let acpi_get_wakeup_address() return 0 if CONFIG_ SUSPEND is not set. Fixes: 366bb35 ("LoongArch: Add suspend (ACPI S3) support") Reviewed-by: WANG Xuerui <[email protected]> Reported-by: Randy Dunlap <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Tiezhu Yang <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent df83033 commit 1cf6248

File tree

1 file changed

+3
-0
lines changed
  • arch/loongarch/include/asm

1 file changed

+3
-0
lines changed

arch/loongarch/include/asm/acpi.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,11 @@ extern void loongarch_suspend_enter(void);
4141

4242
static inline unsigned long acpi_get_wakeup_address(void)
4343
{
44+
#ifdef CONFIG_SUSPEND
4445
extern void loongarch_wakeup_start(void);
4546
return (unsigned long)loongarch_wakeup_start;
47+
#endif
48+
return 0UL;
4649
}
4750

4851
#endif /* _ASM_LOONGARCH_ACPI_H */

0 commit comments

Comments
 (0)