Thread (2 messages) 2 messages, 2 authors, 2021-01-12

Re: [PATCH v2] arch: consolidate pm_power_off callback

From: Will Deacon <will@kernel.org>
Date: 2021-01-12 14:06:07
Also in: linux-alpha, linux-m68k, linux-mips, linux-pm, linux-s390, linux-sh, linuxppc-dev, lkml

On Sun, Dec 27, 2020 at 03:01:28PM +0100, Enrico Weigelt, metux IT consult wrote:
Move the pm_power_off callback into one global place and also add an
function for conditionally calling it (when not NULL), in order to remove
code duplication in all individual archs.

Reported-by: kernel test robot <redacted>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
[...]
quoted hunk ↗ jump to hunk
diff --git a/kernel/reboot.c b/kernel/reboot.c
index eb1b15850761..ec4cd66dd1ae 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -53,6 +53,16 @@ int reboot_force;
 void (*pm_power_off_prepare)(void);
 EXPORT_SYMBOL_GPL(pm_power_off_prepare);
 
+void (*pm_power_off)(void);
+EXPORT_SYMBOL_GPL(pm_power_off);
+
+void do_power_off(void)
+{
+	if (pm_power_off)
+		pm_power_off();
+}
+EXPORT_SYMBOL_GPL(do_power_off);
Could this just live as a static inline in pm.h to avoid having to export
the extra symbol?

Will

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help