diff options
author | Dmitry Osipenko <dmitry.osipenko@collabora.com> | 2022-05-10 02:32:24 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2022-05-19 19:30:30 +0200 |
commit | f0f7e5265b3b37b0aea3d7601607e2e46ea6a9c1 (patch) | |
tree | 0d2b23965d35b2abcb4a24f74804ef15f572f177 /arch/m68k/mac | |
parent | c33fd0b17eab643e13cb8555a0588ae6eee8f657 (diff) | |
download | linux-stable-f0f7e5265b3b37b0aea3d7601607e2e46ea6a9c1.tar.gz linux-stable-f0f7e5265b3b37b0aea3d7601607e2e46ea6a9c1.tar.bz2 linux-stable-f0f7e5265b3b37b0aea3d7601607e2e46ea6a9c1.zip |
m68k: Switch to new sys-off handler API
Kernel now supports chained power-off handlers. Use
register_power_off_handler() that registers power-off handlers and
do_kernel_power_off() that invokes chained power-off handlers. Legacy
pm_power_off() will be removed once all drivers will be converted to
the new sys-off API.
Normally arch code should adopt only the do_kernel_power_off() at first,
but m68k is a special case because it uses pm_power_off() "inside out",
i.e. pm_power_off() invokes machine_power_off() [in fact it does nothing],
while it's machine_power_off() that should invoke the pm_power_off(), and
thus, we can't convert platforms to the new API separately. There are only
two platforms changed here, so it's not a big deal.
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'arch/m68k/mac')
-rw-r--r-- | arch/m68k/mac/config.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index 65d124ec80bb..382f656c29ea 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -12,6 +12,7 @@ #include <linux/errno.h> #include <linux/module.h> +#include <linux/reboot.h> #include <linux/types.h> #include <linux/mm.h> #include <linux/tty.h> @@ -140,7 +141,6 @@ void __init config_mac(void) mach_hwclk = mac_hwclk; mach_reset = mac_reset; mach_halt = mac_poweroff; - mach_power_off = mac_poweroff; #if IS_ENABLED(CONFIG_INPUT_M68K_BEEP) mach_beep = mac_mksound; #endif @@ -160,6 +160,8 @@ void __init config_mac(void) if (macintosh_config->ident == MAC_MODEL_IICI) mach_l2_flush = via_l2_flush; + + register_platform_power_off(mac_poweroff); } |