Add arch_unregister_cpu() to allow the ACPI machinery to call
unregister_cpu(). This is enough for arm64, but needs to be
overridden by x86 and ia64 who need to do more work.
CC: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: James Morse <james.morse@arm.com>
---
arch/ia64/include/asm/cpu.h | 4 ----
arch/loongarch/include/asm/cpu.h | 6 ------
arch/x86/include/asm/cpu.h | 1 -
drivers/base/cpu.c | 5 +++++
4 files changed, 5 insertions(+), 11 deletions(-)
@@ -9,8 +9,4 @@
DECLARE_PER_CPU(int, cpu_state);
-#ifdef CONFIG_HOTPLUG_CPU
-extern void arch_unregister_cpu(int);
-#endif
-
#endif /* _ASM_IA64_CPU_H_ */
@@ -124,10 +124,4 @@ enum cpu_type_enum {
#define LOONGARCH_CPU_GUESTID BIT_ULL(CPU_FEATURE_GUESTID)
#define LOONGARCH_CPU_HYPERVISOR BIT_ULL(CPU_FEATURE_HYPERVISOR)
-#if !defined(__ASSEMBLY__)
-#ifdef CONFIG_HOTPLUG_CPU
-extern void arch_unregister_cpu(int);
-#endif
-#endif /* ! __ASSEMBLY__ */
-
#endif /* _ASM_CPU_H */
@@ -24,7 +24,6 @@ static inline void prefill_possible_map(void) {}
#endif /* CONFIG_SMP */
#ifdef CONFIG_HOTPLUG_CPU
-extern void arch_unregister_cpu(int);
extern void start_cpu0(void);
#ifdef CONFIG_DEBUG_HOTPLUG_CPU0
extern int _debug_hotplug_cpu(int cpu, int action);
@@ -498,6 +498,11 @@ int __weak arch_register_cpu(int cpu)
{
return register_cpu(&per_cpu(cpu_devices, cpu), cpu);
}
+
+void __weak arch_unregister_cpu(int num)
+{
+ unregister_cpu(&per_cpu(cpu_devices, num));
+}
#endif
static void __init cpu_dev_register_generic(void)