···139139void machine_power_off(void)140140{141141 machine_shutdown();142142- if (ppc_md.power_off)143143- ppc_md.power_off();142142+ if (pm_power_off)143143+ pm_power_off();144144#ifdef CONFIG_SMP145145 smp_send_stop();146146#endif···151151/* Used by the G5 thermal driver */152152EXPORT_SYMBOL_GPL(machine_power_off);153153154154-void (*pm_power_off)(void) = machine_power_off;154154+void (*pm_power_off)(void);155155EXPORT_SYMBOL_GPL(pm_power_off);156156157157void machine_halt(void)
···167167 if (ret)168168 goto err;169169170170- /* XXX: this is potentially racy, but there is no lock for ppc_md */171171- if (!ppc_md.power_off) {170170+ /* XXX: this is potentially racy, but there is no lock for pm_power_off */171171+ if (!pm_power_off) {172172 glob_mcu = mcu;173173- ppc_md.power_off = mcu_power_off;173173+ pm_power_off = mcu_power_off;174174 dev_info(&client->dev, "will provide power-off service\n");175175 }176176···197197 device_remove_file(&client->dev, &dev_attr_status);198198199199 if (glob_mcu == mcu) {200200- ppc_md.power_off = NULL;200200+ pm_power_off = NULL;201201 glob_mcu = NULL;202202 }203203
···659659 pr_debug(" <- pSeries_init_early()\n");660660}661661662662+/**663663+ * pseries_power_off - tell firmware about how to power off the system.664664+ *665665+ * This function calls either the power-off rtas token in normal cases666666+ * or the ibm,power-off-ups token (if present & requested) in case of667667+ * a power failure. If power-off token is used, power on will only be668668+ * possible with power button press. If ibm,power-off-ups token is used669669+ * it will allow auto poweron after power is restored.670670+ */671671+static void pseries_power_off(void)672672+{673673+ int rc;674674+ int rtas_poweroff_ups_token = rtas_token("ibm,power-off-ups");675675+676676+ if (rtas_flash_term_hook)677677+ rtas_flash_term_hook(SYS_POWER_OFF);678678+679679+ if (rtas_poweron_auto == 0 ||680680+ rtas_poweroff_ups_token == RTAS_UNKNOWN_SERVICE) {681681+ rc = rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1);682682+ printk(KERN_INFO "RTAS power-off returned %d\n", rc);683683+ } else {684684+ rc = rtas_call(rtas_poweroff_ups_token, 0, 1, NULL);685685+ printk(KERN_INFO "RTAS ibm,power-off-ups returned %d\n", rc);686686+ }687687+ for (;;);688688+}689689+662690/*663691 * Called very early, MMU is off, device-tree isn't unflattened664692 */···769741 else770742 hpte_init_native();771743744744+ pm_power_off = pseries_power_off;745745+772746 pr_debug("Machine is%s LPAR !\n",773747 (powerpc_firmware_features & FW_FEATURE_LPAR) ? "" : " not");774748···782752 if (firmware_has_feature(FW_FEATURE_LPAR))783753 return PCI_PROBE_DEVTREE;784754 return PCI_PROBE_NORMAL;785785-}786786-787787-/**788788- * pSeries_power_off - tell firmware about how to power off the system.789789- *790790- * This function calls either the power-off rtas token in normal cases791791- * or the ibm,power-off-ups token (if present & requested) in case of792792- * a power failure. If power-off token is used, power on will only be793793- * possible with power button press. If ibm,power-off-ups token is used794794- * it will allow auto poweron after power is restored.795795- */796796-static void pSeries_power_off(void)797797-{798798- int rc;799799- int rtas_poweroff_ups_token = rtas_token("ibm,power-off-ups");800800-801801- if (rtas_flash_term_hook)802802- rtas_flash_term_hook(SYS_POWER_OFF);803803-804804- if (rtas_poweron_auto == 0 ||805805- rtas_poweroff_ups_token == RTAS_UNKNOWN_SERVICE) {806806- rc = rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1);807807- printk(KERN_INFO "RTAS power-off returned %d\n", rc);808808- } else {809809- rc = rtas_call(rtas_poweroff_ups_token, 0, 1, NULL);810810- printk(KERN_INFO "RTAS ibm,power-off-ups returned %d\n", rc);811811- }812812- for (;;);813755}814756815757#ifndef CONFIG_PCI···798796 .pcibios_fixup = pSeries_final_fixup,799797 .pci_probe_mode = pSeries_pci_probe_mode,800798 .restart = rtas_restart,801801- .power_off = pSeries_power_off,802799 .halt = rtas_halt,803800 .panic = rtas_os_term,804801 .get_boot_time = rtas_get_boot_time,
+1-1
arch/powerpc/sysdev/fsl_soc.c
···238238/*239239 * Halt the current partition240240 *241241- * This function should be assigned to the ppc_md.power_off and ppc_md.halt241241+ * This function should be assigned to the pm_power_off and ppc_md.halt242242 * function pointers, to shut down the partition when we're running under243243 * the Freescale hypervisor.244244 */
+2-1
arch/powerpc/xmon/xmon.c
···981981 else if (cmd == 'h')982982 ppc_md.halt();983983 else if (cmd == 'p')984984- ppc_md.power_off();984984+ if (pm_power_off)985985+ pm_power_off();985986}986987987988static int cpu_cmd(void)