Skip to contentSkip to conversation

m68k: virt: Switch to new sys-off handler API

PATCH In review Geert Uytterhoeven 3 participants 3 messages May 23, 2022 m68k architecture

lore
Share & tools
lore

Geert Uytterhoeven

author maintainer
#0 lore raw

PATCH 1/1 m68k: virt: Switch to new sys-off handler API

On m68k with CONFIG_VIRT=y (e.g. virt_defconfig or allmodconfig):

arch/m68k/virt/config.c: In function ‘config_virt’:
arch/m68k/virt/config.c:129:2: error: ‘mach_power_off’ undeclared (first use in this function); did you mean ‘pm_power_off’?
129 | mach_power_off = virt_halt;
| ^~~~~~~~~~~~~~
| pm_power_off

Commit 05d51e42df06f021 ("m68k: Introduce a virtual m68k machine") introduced a new user of mach_power_off.
Convert it to the new sys-off handler API, too.

Reported-by [email protected]
Fixes f0f7e5265b3b37b0 ("m68k: Switch to new sys-off handler API")
---
 arch/m68k/virt/config.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/m68k/virt/config.c +3 -1
index 68d29c8b87e18840..632ba200ad425245 100644
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 
+#include <linux/reboot.h>
 #include <linux/serial_core.h>
 #include <clocksource/timer-goldfish.h>
 
@@ -126,5 +127,6 @@ void __init config_virt(void)
 	mach_get_model = virt_get_model;
 	mach_reset = virt_reset;
 	mach_halt = virt_halt;
-	mach_power_off = virt_halt;
+
+	register_platform_power_off(virt_halt);
 }
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 31 lines · Geert Uytterhoeven

On m68k with CONFIG_VIRT=y (e.g. virt_defconfig or allmodconfig):

arch/m68k/virt/config.c: In function ‘config_virt’:
arch/m68k/virt/config.c:129:2: error: ‘mach_power_off’ undeclared (first use in this function); did you mean ‘pm_power_off’?
129 | mach_power_off = virt_halt;
| ^~~~~~~~~~~~~~
| pm_power_off

Commit 05d51e42df06f021 ("m68k: Introduce a virtual m68k machine") introduced a new user of mach_power_off.
Convert it to the new sys-off handler API, too.

Reported-by [email protected]
Fixes f0f7e5265b3b37b0 ("m68k: Switch to new sys-off handler API")
---
 arch/m68k/virt/config.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/m68k/virt/config.c +1 -0
index 68d29c8b87e18840..632ba200ad425245 100644
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 
+#include <linux/reboot.h>
 #include <linux/serial_core.h>
 #include <clocksource/timer-goldfish.h>
 

arch/m68k/virt/config.c void __init config_virt(void) · line 132

Quoted 7 lines
arch/m68k/virt/config.c +2 -1
@@ -126,5 +127,6 @@ void __init config_virt(void)
 	mach_get_model = virt_get_model;
 	mach_reset = virt_reset;
 	mach_halt = virt_halt;
-	mach_power_off = virt_halt;
+
+	register_platform_power_off(virt_halt);
 }

Thanks, Geert! Indeed, I only compile-tested files that were directly affected by the core changes and haven't checked the whole m68k build, that was my oversight.

Signature · 2 lines
Best regards,
Dmitry
Reviewed-by on v1 1/1
#2 lore raw
In reply to Geert Uytterhoeven

Le 23/05/2022 à 19:55, Geert Uytterhoeven a écrit :

Quoted 31 lines

On m68k with CONFIG_VIRT=y (e.g. virt_defconfig or allmodconfig):

arch/m68k/virt/config.c: In function ‘config_virt’:
arch/m68k/virt/config.c:129:2: error: ‘mach_power_off’ undeclared (first use in this function); did you mean ‘pm_power_off’?
129 | mach_power_off = virt_halt;
| ^~~~~~~~~~~~~~
| pm_power_off

Commit 05d51e42df06f021 ("m68k: Introduce a virtual m68k machine") introduced a new user of mach_power_off.
Convert it to the new sys-off handler API, too.

Reported-by [email protected]
Fixes f0f7e5265b3b37b0 ("m68k: Switch to new sys-off handler API")
---
  arch/m68k/virt/config.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
arch/m68k/virt/config.c +1 -0
index 68d29c8b87e18840..632ba200ad425245 100644
@@ -1,5 +1,6 @@
  // SPDX-License-Identifier: GPL-2.0
 
+#include <linux/reboot.h>
  #include <linux/serial_core.h>
  #include <clocksource/timer-goldfish.h>
 

arch/m68k/virt/config.c void __init config_virt(void) · line 132

Quoted 7 lines
arch/m68k/virt/config.c +2 -1
@@ -126,5 +127,6 @@ void __init config_virt(void)
  	mach_get_model = virt_get_model;
  	mach_reset = virt_reset;
  	mach_halt = virt_halt;
-	mach_power_off = virt_halt;
+
+	register_platform_power_off(virt_halt);
  }