All of lore.kernel.org
 help / color / mirror / Atom feed
From: linux@treblig.org
To: akpm@linux-foundation.org, dmitry.osipenko@collabora.com
Cc: linux-kernel@vger.kernel.org,
	"Dr. David Alan Gilbert" <linux@treblig.org>
Subject: [PATCH] reboot: Remove unused unregister_platform_power_off
Date: Sun,  8 Jun 2025 18:42:35 +0100	[thread overview]
Message-ID: <20250608174235.116424-1-linux@treblig.org> (raw)

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


             reply	other threads:[~2025-06-08 17:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-08 17:42 linux [this message]
2025-06-08 20:03 ` [PATCH] reboot: Remove unused unregister_platform_power_off Dmitry Osipenko
2025-06-09 12:24   ` Dr. David Alan Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250608174235.116424-1-linux@treblig.org \
    --to=linux@treblig.org \
    --cc=akpm@linux-foundation.org \
    --cc=dmitry.osipenko@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.