summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Morse <james.morse@arm.com>2022-07-07 17:36:25 +0100
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2023-10-23 10:05:40 +0100
commit13d91ec9c2629b2dccd080f6ba33a944cd980e9e (patch)
treed3439c3cae1f63e5a3c03be8482faf3e4c9f70e5
parent729f29da12d4add1d4c365659e27b7da03bd9132 (diff)
drivers: base: Implement weak arch_unregister_cpu()
Add arch_unregister_cpu() to allow the ACPI machinery to call unregister_cpu(). This is enough for arm64, riscv and loongarch, 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> --- Changes since v1: * Added CONFIG_HOTPLUG_CPU ifdeffery around unregister_cpu Changes since RFC v2: * Move earlier in the series
-rw-r--r--drivers/base/cpu.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 6c70a004c198..2b9cb2667654 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -531,7 +531,14 @@ int __weak arch_register_cpu(int cpu)
{
return register_cpu(&per_cpu(cpu_devices, cpu), cpu);
}
-#endif
+
+#ifdef CONFIG_HOTPLUG_CPU
+void __weak arch_unregister_cpu(int num)
+{
+ unregister_cpu(&per_cpu(cpu_devices, num));
+}
+#endif /* CONFIG_HOTPLUG_CPU */
+#endif /* CONFIG_GENERIC_CPU_DEVICES */
static void __init cpu_dev_register_generic(void)
{