[PATCH v2 20/20] powerpc: Remove ppc_md.power_off

Alexander Graf agraf at suse.de
Tue Oct 14 01:01:28 AEDT 2014


Now that we have all implementations of ppc_md.power_off converted to
pm_power_off we can remove the ppc_md variant.

While at it, also set the default for pm_power_off to NULL so that non
machine drivers can implement overrides.

Signed-off-by: Alexander Graf <agraf at suse.de>
---
 arch/powerpc/include/asm/machdep.h | 1 -
 arch/powerpc/kernel/setup-common.c | 6 ++----
 arch/powerpc/xmon/xmon.c           | 2 --
 3 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index 307347f..f15f15c 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -142,7 +142,6 @@ struct machdep_calls {
 #endif
 
 	void		(*restart)(char *cmd);
-	void		(*power_off)(void);
 	void		(*halt)(void);
 	void		(*panic)(char *str);
 	void		(*cpu_die)(void);
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 6398239..44c8d03 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -139,9 +139,7 @@ void machine_restart(char *cmd)
 void machine_power_off(void)
 {
 	machine_shutdown();
-	if (ppc_md.power_off)
-		ppc_md.power_off();
-	if (pm_power_off != machine_power_off)
+	if (pm_power_off)
 		pm_power_off();
 #ifdef CONFIG_SMP
 	smp_send_stop();
@@ -153,7 +151,7 @@ void machine_power_off(void)
 /* Used by the G5 thermal driver */
 EXPORT_SYMBOL_GPL(machine_power_off);
 
-void (*pm_power_off)(void) = machine_power_off;
+void (*pm_power_off)(void);
 EXPORT_SYMBOL_GPL(pm_power_off);
 
 void machine_halt(void)
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 531f649..506d256 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -981,8 +981,6 @@ static void bootcmds(void)
 	else if (cmd == 'h')
 		ppc_md.halt();
 	else if (cmd == 'p')
-		if (ppc_md.power_off)
-			ppc_md.power_off();
 		if (pm_power_off)
 			pm_power_off();
 }
-- 
1.8.1.4



More information about the Linuxppc-dev mailing list