public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] reboot: Remove unused unregister_platform_power_off
@ 2025-06-08 17:42 linux
  2025-06-08 20:03 ` Dmitry Osipenko
  0 siblings, 1 reply; 3+ messages in thread
From: linux @ 2025-06-08 17:42 UTC (permalink / raw)
  To: akpm, dmitry.osipenko; +Cc: linux-kernel, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <linux@treblig.org>

unregister_platform_power_off() was added as part of 2022's
commit fb61375ecfba ("kernel/reboot: Add register_platform_power_off()")
but has remained unused.

Remove it.

Note it's a pair with register_platform_power_off() so
seems symmetric; however, I think platforms are chosen
and then stay that way for the boot - so don't
get unregistered.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 include/linux/reboot.h |  1 -
 kernel/reboot.c        | 16 ----------------
 2 files changed, 17 deletions(-)

diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index aa08c3bbbf59..82c0a373c58c 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -161,7 +161,6 @@ int devm_register_restart_handler(struct device *dev,
 				  void *cb_data);
 
 int register_platform_power_off(void (*power_off)(void));
-void unregister_platform_power_off(void (*power_off)(void));
 
 /*
  * Architecture independent implemenations of sys_reboot commands.
diff --git a/kernel/reboot.c b/kernel/reboot.c
index ec087827c85c..515716afc101 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -626,22 +626,6 @@ int register_platform_power_off(void (*power_off)(void))
 }
 EXPORT_SYMBOL_GPL(register_platform_power_off);
 
-/**
- *	unregister_platform_power_off - Unregister platform-level power-off callback
- *	@power_off: Power-off callback
- *
- *	Unregisters previously registered platform power-off callback.
- */
-void unregister_platform_power_off(void (*power_off)(void))
-{
-	if (platform_power_off_handler &&
-	    platform_power_off_handler->cb_data == power_off) {
-		unregister_sys_off_handler(platform_power_off_handler);
-		platform_power_off_handler = NULL;
-	}
-}
-EXPORT_SYMBOL_GPL(unregister_platform_power_off);
-
 static int legacy_pm_power_off(struct sys_off_data *data)
 {
 	if (pm_power_off)
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-09 12:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-08 17:42 [PATCH] reboot: Remove unused unregister_platform_power_off linux
2025-06-08 20:03 ` Dmitry Osipenko
2025-06-09 12:24   ` Dr. David Alan Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox