diff --git a/include/linux/pm.h b/include/linux/pm.h index 6cdf279c7f2fd67241895245129375a540cac6ef..627e15f23084842a0df45c88a5367bfc0fe6794c 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -17,11 +17,6 @@ #include <linux/hrtimer.h> #include <linux/completion.h> -/* - * Callbacks for platform drivers to implement. - */ -extern void (*pm_power_off)(void); - struct device; /* we have a circular dep with device.h */ #ifdef CONFIG_VT_CONSOLE_SLEEP extern void pm_vt_switch_required(struct device *dev, bool required); diff --git a/kernel/reboot.c b/kernel/reboot.c index 3053429df024a5f368684e22d4fb44fb59e46acb..687de1a72034bd568a3499840c9235830b7f83e7 100644 --- a/kernel/reboot.c +++ b/kernel/reboot.c @@ -293,19 +293,6 @@ EXPORT_SYMBOL_GPL(kernel_halt); */ static BLOCKING_NOTIFIER_HEAD(power_off_handler_list); -/* - * Temporary stub that prevents linkage failure while we're in process - * of removing all uses of legacy pm_power_off() around the kernel. - */ -void __weak (*pm_power_off)(void); - -static void dummy_pm_power_off(void) -{ - /* temporary stub until pm_power_off() is gone, see more below */ -} - -static struct notifier_block *pm_power_off_nb; - /** * register_power_off_handler - Register function to be called to power off * the system @@ -350,12 +337,9 @@ static int register_power_off_handler(struct notifier_block *nb) int ret; ret = blocking_notifier_chain_register_unique_prio(&power_off_handler_list, nb); - if (ret && ret != -EBUSY) + if (ret != -EBUSY) return ret; - if (!ret) - goto set_pm_power_off; - /* * Handler must have unique priority. Otherwise call order is * determined by registration order, which is unreliable. @@ -365,33 +349,11 @@ static int register_power_off_handler(struct notifier_block *nb) */ pr_err("failed to register power-off handler using unique priority\n"); - ret = blocking_notifier_chain_register(&power_off_handler_list, nb); - if (ret) - return ret; - - /* - * Some drivers check whether pm_power_off was already installed. - * Install dummy callback using new API to preserve old behaviour - * for those drivers during period of transition to the new API. - */ -set_pm_power_off: - if (!pm_power_off) { - pm_power_off = dummy_pm_power_off; - pm_power_off_nb = nb; - } - - return 0; + return blocking_notifier_chain_register(&power_off_handler_list, nb); } static int unregister_power_off_handler(struct notifier_block *nb) { - if (nb == pm_power_off_nb) { - if (pm_power_off == dummy_pm_power_off) - pm_power_off = NULL; - - pm_power_off_nb = NULL; - } - return blocking_notifier_chain_unregister(&power_off_handler_list, nb); } @@ -858,10 +820,6 @@ EXPORT_SYMBOL_GPL(unregister_platform_power_off); */ void do_kernel_power_off(void) { - /* legacy pm_power_off() is unchained and has highest priority */ - if (pm_power_off && pm_power_off != dummy_pm_power_off) - return pm_power_off(); - blocking_notifier_call_chain(&power_off_handler_list, POWEROFF_NORMAL, NULL); } @@ -891,8 +849,7 @@ EXPORT_SYMBOL_GPL(kernel_power_off); bool kernel_can_power_off(void) { - if (!pm_power_off && - blocking_notifier_call_chain_is_empty(&power_off_handler_list)) + if (blocking_notifier_call_chain_is_empty(&power_off_handler_list)) return false; return true;