linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] Switch more ARM plats to sys-off handler API
@ 2024-07-29 12:35 Andrew Davis
  2024-07-29 12:35 ` [PATCH v2 1/7] ARM: highbank: Switch to new " Andrew Davis
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Andrew Davis @ 2024-07-29 12:35 UTC (permalink / raw)
  To: Andre Przywara, Russell King, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Andrew Lunn,
	Sebastian Hesselbarth, Gregory Clement, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik
  Cc: linux-arm-kernel, linux-kernel, imx, Andrew Davis

Hello all,

Continuing the quest to remove the legacy pm_power_off() global
function handler. Remove uses from arch/arm/ using the helper
register_platform_power_off().

Thanks,
Andrew

Changes for v2:
 - Collect Reviewed/Acked-bys
 - Rebase on v6.11-rc1

Andrew Davis (7):
  ARM: highbank: Switch to new sys-off handler API
  ARM: imx: Switch to new sys-off handler API
  ARM: orion5x: Switch to new sys-off handler API
  ARM: pxa: Switch to new sys-off handler API
  ARM: sa1100: Switch to new sys-off handler API
  ARM: vt8500: Switch to new sys-off handler API
  arm/xen: Switch to new sys-off handler API

 arch/arm/mach-highbank/highbank.c              | 2 +-
 arch/arm/mach-imx/pm-imx6.c                    | 6 ++----
 arch/arm/mach-orion5x/board-mss2.c             | 2 +-
 arch/arm/mach-orion5x/dns323-setup.c           | 6 +++---
 arch/arm/mach-orion5x/kurobox_pro-setup.c      | 2 +-
 arch/arm/mach-orion5x/mv2120-setup.c           | 2 +-
 arch/arm/mach-orion5x/net2big-setup.c          | 2 +-
 arch/arm/mach-orion5x/terastation_pro2-setup.c | 2 +-
 arch/arm/mach-orion5x/ts209-setup.c            | 2 +-
 arch/arm/mach-orion5x/ts409-setup.c            | 2 +-
 arch/arm/mach-pxa/spitz.c                      | 2 +-
 arch/arm/mach-sa1100/generic.c                 | 2 +-
 arch/arm/mach-vt8500/vt8500.c                  | 2 +-
 arch/arm/xen/enlighten.c                       | 2 +-
 14 files changed, 17 insertions(+), 19 deletions(-)

-- 
2.39.2



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 1/7] ARM: highbank: Switch to new sys-off handler API
  2024-07-29 12:35 [PATCH v2 0/7] Switch more ARM plats to sys-off handler API Andrew Davis
@ 2024-07-29 12:35 ` Andrew Davis
  2024-07-29 12:35 ` [PATCH v2 2/7] ARM: imx: " Andrew Davis
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Andrew Davis @ 2024-07-29 12:35 UTC (permalink / raw)
  To: Andre Przywara, Russell King, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Andrew Lunn,
	Sebastian Hesselbarth, Gregory Clement, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik
  Cc: linux-arm-kernel, linux-kernel, imx, Andrew Davis

Kernel now supports chained power-off handlers. Use
register_platform_power_off() that registers a platform level power-off
handler. Legacy pm_power_off() will be removed once all drivers and archs
are converted to the new sys-off API.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
---
 arch/arm/mach-highbank/highbank.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c
index 5d4f977ac7d2a..47335c7dadf8d 100644
--- a/arch/arm/mach-highbank/highbank.c
+++ b/arch/arm/mach-highbank/highbank.c
@@ -143,7 +143,7 @@ static void __init highbank_init(void)
 	sregs_base = of_iomap(np, 0);
 	WARN_ON(!sregs_base);
 
-	pm_power_off = highbank_power_off;
+	register_platform_power_off(highbank_power_off);
 	highbank_pm_init();
 
 	bus_register_notifier(&platform_bus_type, &highbank_platform_nb);
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 2/7] ARM: imx: Switch to new sys-off handler API
  2024-07-29 12:35 [PATCH v2 0/7] Switch more ARM plats to sys-off handler API Andrew Davis
  2024-07-29 12:35 ` [PATCH v2 1/7] ARM: highbank: Switch to new " Andrew Davis
@ 2024-07-29 12:35 ` Andrew Davis
  2024-07-29 12:35 ` [PATCH v2 3/7] ARM: orion5x: " Andrew Davis
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Andrew Davis @ 2024-07-29 12:35 UTC (permalink / raw)
  To: Andre Przywara, Russell King, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Andrew Lunn,
	Sebastian Hesselbarth, Gregory Clement, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik
  Cc: linux-arm-kernel, linux-kernel, imx, Andrew Davis

Kernel now supports chained power-off handlers. Use
register_platform_power_off() that registers a platform level power-off
handler. Legacy pm_power_off() will be removed once all drivers and archs
are converted to the new sys-off API.

Signed-off-by: Andrew Davis <afd@ti.com>
Acked-by: Shawn Guo <shawnguo@kernel.org>
---
 arch/arm/mach-imx/pm-imx6.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c
index b36f05b54cc76..a671ca498f887 100644
--- a/arch/arm/mach-imx/pm-imx6.c
+++ b/arch/arm/mach-imx/pm-imx6.c
@@ -634,13 +634,11 @@ static void imx6_pm_stby_poweroff(void)
 
 static int imx6_pm_stby_poweroff_probe(void)
 {
-	if (pm_power_off) {
-		pr_warn("%s: pm_power_off already claimed  %p %ps!\n",
-			__func__, pm_power_off, pm_power_off);
+	if (register_platform_power_off(imx6_pm_stby_poweroff)) {
+		pr_warn("%s: platform power off already claimed!\n", __func__);
 		return -EBUSY;
 	}
 
-	pm_power_off = imx6_pm_stby_poweroff;
 	return 0;
 }
 
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 3/7] ARM: orion5x: Switch to new sys-off handler API
  2024-07-29 12:35 [PATCH v2 0/7] Switch more ARM plats to sys-off handler API Andrew Davis
  2024-07-29 12:35 ` [PATCH v2 1/7] ARM: highbank: Switch to new " Andrew Davis
  2024-07-29 12:35 ` [PATCH v2 2/7] ARM: imx: " Andrew Davis
@ 2024-07-29 12:35 ` Andrew Davis
  2024-09-02 14:28   ` Gregory CLEMENT
  2024-07-29 12:35 ` [PATCH v2 4/7] ARM: pxa: " Andrew Davis
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 9+ messages in thread
From: Andrew Davis @ 2024-07-29 12:35 UTC (permalink / raw)
  To: Andre Przywara, Russell King, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Andrew Lunn,
	Sebastian Hesselbarth, Gregory Clement, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik
  Cc: linux-arm-kernel, linux-kernel, imx, Andrew Davis

Kernel now supports chained power-off handlers. Use
register_platform_power_off() that registers a platform level power-off
handler. Legacy pm_power_off() will be removed once all drivers and archs
are converted to the new sys-off API.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
 arch/arm/mach-orion5x/board-mss2.c             | 2 +-
 arch/arm/mach-orion5x/dns323-setup.c           | 6 +++---
 arch/arm/mach-orion5x/kurobox_pro-setup.c      | 2 +-
 arch/arm/mach-orion5x/mv2120-setup.c           | 2 +-
 arch/arm/mach-orion5x/net2big-setup.c          | 2 +-
 arch/arm/mach-orion5x/terastation_pro2-setup.c | 2 +-
 arch/arm/mach-orion5x/ts209-setup.c            | 2 +-
 arch/arm/mach-orion5x/ts409-setup.c            | 2 +-
 8 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-orion5x/board-mss2.c b/arch/arm/mach-orion5x/board-mss2.c
index b0f16d223adf5..9e3d69891d2f6 100644
--- a/arch/arm/mach-orion5x/board-mss2.c
+++ b/arch/arm/mach-orion5x/board-mss2.c
@@ -82,5 +82,5 @@ static void mss2_power_off(void)
 void __init mss2_init(void)
 {
 	/* register mss2 specific power-off method */
-	pm_power_off = mss2_power_off;
+	register_platform_power_off(mss2_power_off);
 }
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
index 062109efa0ecc..fcd38ff7ca459 100644
--- a/arch/arm/mach-orion5x/dns323-setup.c
+++ b/arch/arm/mach-orion5x/dns323-setup.c
@@ -700,7 +700,7 @@ static void __init dns323_init(void)
 		if (gpio_request(DNS323_GPIO_POWER_OFF, "POWEROFF") != 0 ||
 		    gpio_direction_output(DNS323_GPIO_POWER_OFF, 0) != 0)
 			pr_err("DNS-323: failed to setup power-off GPIO\n");
-		pm_power_off = dns323a_power_off;
+		register_platform_power_off(dns323a_power_off);
 		break;
 	case DNS323_REV_B1:
 		/* 5182 built-in SATA init */
@@ -717,7 +717,7 @@ static void __init dns323_init(void)
 		if (gpio_request(DNS323_GPIO_POWER_OFF, "POWEROFF") != 0 ||
 		    gpio_direction_output(DNS323_GPIO_POWER_OFF, 0) != 0)
 			pr_err("DNS-323: failed to setup power-off GPIO\n");
-		pm_power_off = dns323b_power_off;
+		register_platform_power_off(dns323b_power_off);
 		break;
 	case DNS323_REV_C1:
 		/* 5182 built-in SATA init */
@@ -727,7 +727,7 @@ static void __init dns323_init(void)
 		if (gpio_request(DNS323C_GPIO_POWER_OFF, "POWEROFF") != 0 ||
 		    gpio_direction_output(DNS323C_GPIO_POWER_OFF, 0) != 0)
 			pr_err("DNS-323: failed to setup power-off GPIO\n");
-		pm_power_off = dns323c_power_off;
+		register_platform_power_off(dns323c_power_off);
 
 		/* Now, -this- should theoretically be done by the sata_mv driver
 		 * once I figure out what's going on there. Maybe the behaviour
diff --git a/arch/arm/mach-orion5x/kurobox_pro-setup.c b/arch/arm/mach-orion5x/kurobox_pro-setup.c
index acba066180801..339b10891808f 100644
--- a/arch/arm/mach-orion5x/kurobox_pro-setup.c
+++ b/arch/arm/mach-orion5x/kurobox_pro-setup.c
@@ -373,7 +373,7 @@ static void __init kurobox_pro_init(void)
 	i2c_register_board_info(0, &kurobox_pro_i2c_rtc, 1);
 
 	/* register Kurobox Pro specific power-off method */
-	pm_power_off = kurobox_pro_power_off;
+	register_platform_power_off(kurobox_pro_power_off);
 }
 
 #ifdef CONFIG_MACH_KUROBOX_PRO
diff --git a/arch/arm/mach-orion5x/mv2120-setup.c b/arch/arm/mach-orion5x/mv2120-setup.c
index b7327a6128353..5b0249f109cde 100644
--- a/arch/arm/mach-orion5x/mv2120-setup.c
+++ b/arch/arm/mach-orion5x/mv2120-setup.c
@@ -238,7 +238,7 @@ static void __init mv2120_init(void)
 	if (gpio_request(MV2120_GPIO_POWER_OFF, "POWEROFF") != 0 ||
 	    gpio_direction_output(MV2120_GPIO_POWER_OFF, 1) != 0)
 		pr_err("mv2120: failed to setup power-off GPIO\n");
-	pm_power_off = mv2120_power_off;
+	register_platform_power_off(mv2120_power_off);
 }
 
 /* Warning: HP uses a wrong mach-type (=526) in their bootloader */
diff --git a/arch/arm/mach-orion5x/net2big-setup.c b/arch/arm/mach-orion5x/net2big-setup.c
index 6ad9740b426b6..4afd9b4c71a94 100644
--- a/arch/arm/mach-orion5x/net2big-setup.c
+++ b/arch/arm/mach-orion5x/net2big-setup.c
@@ -423,7 +423,7 @@ static void __init net2big_init(void)
 
 	if (gpio_request(NET2BIG_GPIO_POWER_OFF, "power-off") == 0 &&
 	    gpio_direction_output(NET2BIG_GPIO_POWER_OFF, 0) == 0)
-		pm_power_off = net2big_power_off;
+		register_platform_power_off(net2big_power_off);
 	else
 		pr_err("net2big: failed to configure power-off GPIO\n");
 
diff --git a/arch/arm/mach-orion5x/terastation_pro2-setup.c b/arch/arm/mach-orion5x/terastation_pro2-setup.c
index 23a5521c68336..a9f01859d1012 100644
--- a/arch/arm/mach-orion5x/terastation_pro2-setup.c
+++ b/arch/arm/mach-orion5x/terastation_pro2-setup.c
@@ -349,7 +349,7 @@ static void __init tsp2_init(void)
 	i2c_register_board_info(0, &tsp2_i2c_rtc, 1);
 
 	/* register Terastation Pro II specific power-off method */
-	pm_power_off = tsp2_power_off;
+	register_platform_power_off(tsp2_power_off);
 }
 
 MACHINE_START(TERASTATION_PRO2, "Buffalo Terastation Pro II/Live")
diff --git a/arch/arm/mach-orion5x/ts209-setup.c b/arch/arm/mach-orion5x/ts209-setup.c
index bab8ba0e01ab9..de9092e992c56 100644
--- a/arch/arm/mach-orion5x/ts209-setup.c
+++ b/arch/arm/mach-orion5x/ts209-setup.c
@@ -314,7 +314,7 @@ static void __init qnap_ts209_init(void)
 	i2c_register_board_info(0, &qnap_ts209_i2c_rtc, 1);
 
 	/* register tsx09 specific power-off method */
-	pm_power_off = qnap_tsx09_power_off;
+	register_platform_power_off(qnap_tsx09_power_off);
 }
 
 MACHINE_START(TS209, "QNAP TS-109/TS-209")
diff --git a/arch/arm/mach-orion5x/ts409-setup.c b/arch/arm/mach-orion5x/ts409-setup.c
index 8131982c10d97..725688aa5cba7 100644
--- a/arch/arm/mach-orion5x/ts409-setup.c
+++ b/arch/arm/mach-orion5x/ts409-setup.c
@@ -312,7 +312,7 @@ static void __init qnap_ts409_init(void)
 	platform_device_register(&ts409_leds);
 
 	/* register tsx09 specific power-off method */
-	pm_power_off = qnap_tsx09_power_off;
+	register_platform_power_off(qnap_tsx09_power_off);
 }
 
 MACHINE_START(TS409, "QNAP TS-409")
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 4/7] ARM: pxa: Switch to new sys-off handler API
  2024-07-29 12:35 [PATCH v2 0/7] Switch more ARM plats to sys-off handler API Andrew Davis
                   ` (2 preceding siblings ...)
  2024-07-29 12:35 ` [PATCH v2 3/7] ARM: orion5x: " Andrew Davis
@ 2024-07-29 12:35 ` Andrew Davis
  2024-07-29 12:35 ` [PATCH v2 5/7] ARM: sa1100: " Andrew Davis
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Andrew Davis @ 2024-07-29 12:35 UTC (permalink / raw)
  To: Andre Przywara, Russell King, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Andrew Lunn,
	Sebastian Hesselbarth, Gregory Clement, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik
  Cc: linux-arm-kernel, linux-kernel, imx, Andrew Davis

Kernel now supports chained power-off handlers. Use
register_platform_power_off() that registers a platform level power-off
handler. Legacy pm_power_off() will be removed once all drivers and archs
are converted to the new sys-off API.

Signed-off-by: Andrew Davis <afd@ti.com>
---
 arch/arm/mach-pxa/spitz.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 452bf7aac1fad..c8db4eec59465 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -1041,7 +1041,7 @@ static void __init spitz_init(void)
 		software_node_register(&spitz_scoop_2_gpiochip_node);
 
 	init_gpio_reset(SPITZ_GPIO_ON_RESET, 1, 0);
-	pm_power_off = spitz_poweroff;
+	register_platform_power_off(spitz_poweroff);
 
 	PMCR = 0x00;
 
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 5/7] ARM: sa1100: Switch to new sys-off handler API
  2024-07-29 12:35 [PATCH v2 0/7] Switch more ARM plats to sys-off handler API Andrew Davis
                   ` (3 preceding siblings ...)
  2024-07-29 12:35 ` [PATCH v2 4/7] ARM: pxa: " Andrew Davis
@ 2024-07-29 12:35 ` Andrew Davis
  2024-07-29 12:35 ` [PATCH v2 6/7] ARM: vt8500: " Andrew Davis
  2024-07-29 12:35 ` [PATCH v2 7/7] arm/xen: " Andrew Davis
  6 siblings, 0 replies; 9+ messages in thread
From: Andrew Davis @ 2024-07-29 12:35 UTC (permalink / raw)
  To: Andre Przywara, Russell King, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Andrew Lunn,
	Sebastian Hesselbarth, Gregory Clement, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik
  Cc: linux-arm-kernel, linux-kernel, imx, Andrew Davis

Kernel now supports chained power-off handlers. Use
register_platform_power_off() that registers a platform level power-off
handler. Legacy pm_power_off() will be removed once all drivers and archs
are converted to the new sys-off API.

Signed-off-by: Andrew Davis <afd@ti.com>
---
 arch/arm/mach-sa1100/generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index 0c586047d130f..5383a26f51169 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -298,7 +298,7 @@ static struct platform_device *sa11x0_devices[] __initdata = {
 static int __init sa1100_init(void)
 {
 	struct resource wdt_res = DEFINE_RES_MEM(0x90000000, 0x20);
-	pm_power_off = sa1100_power_off;
+	register_platform_power_off(sa1100_power_off);
 
 	regulator_has_full_constraints();
 
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 6/7] ARM: vt8500: Switch to new sys-off handler API
  2024-07-29 12:35 [PATCH v2 0/7] Switch more ARM plats to sys-off handler API Andrew Davis
                   ` (4 preceding siblings ...)
  2024-07-29 12:35 ` [PATCH v2 5/7] ARM: sa1100: " Andrew Davis
@ 2024-07-29 12:35 ` Andrew Davis
  2024-07-29 12:35 ` [PATCH v2 7/7] arm/xen: " Andrew Davis
  6 siblings, 0 replies; 9+ messages in thread
From: Andrew Davis @ 2024-07-29 12:35 UTC (permalink / raw)
  To: Andre Przywara, Russell King, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Andrew Lunn,
	Sebastian Hesselbarth, Gregory Clement, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik
  Cc: linux-arm-kernel, linux-kernel, imx, Andrew Davis

Kernel now supports chained power-off handlers. Use
register_platform_power_off() that registers a platform level power-off
handler. Legacy pm_power_off() will be removed once all drivers and archs
are converted to the new sys-off API.

Signed-off-by: Andrew Davis <afd@ti.com>
---
 arch/arm/mach-vt8500/vt8500.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-vt8500/vt8500.c b/arch/arm/mach-vt8500/vt8500.c
index 0ab40087ae1cc..1d294255d7083 100644
--- a/arch/arm/mach-vt8500/vt8500.c
+++ b/arch/arm/mach-vt8500/vt8500.c
@@ -141,7 +141,7 @@ static void __init vt8500_init(void)
 			pr_err("%s:ioremap(power_off) failed\n", __func__);
 	}
 	if (pmc_base)
-		pm_power_off = &vt8500_power_off;
+		register_platform_power_off(vt8500_power_off);
 	else
 		pr_err("%s: PMC Hibernation register could not be remapped, not enabling power off!\n", __func__);
 }
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 7/7] arm/xen: Switch to new sys-off handler API
  2024-07-29 12:35 [PATCH v2 0/7] Switch more ARM plats to sys-off handler API Andrew Davis
                   ` (5 preceding siblings ...)
  2024-07-29 12:35 ` [PATCH v2 6/7] ARM: vt8500: " Andrew Davis
@ 2024-07-29 12:35 ` Andrew Davis
  6 siblings, 0 replies; 9+ messages in thread
From: Andrew Davis @ 2024-07-29 12:35 UTC (permalink / raw)
  To: Andre Przywara, Russell King, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Andrew Lunn,
	Sebastian Hesselbarth, Gregory Clement, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik
  Cc: linux-arm-kernel, linux-kernel, imx, Andrew Davis

Kernel now supports chained power-off handlers. Use
register_platform_power_off() that registers a platform level power-off
handler. Legacy pm_power_off() will be removed once all drivers and archs
are converted to the new sys-off API.

Signed-off-by: Andrew Davis <afd@ti.com>
---
 arch/arm/xen/enlighten.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index a395b6c0aae2a..8655bc3d36347 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -541,7 +541,7 @@ static int __init xen_late_init(void)
 	if (!xen_domain())
 		return -ENODEV;
 
-	pm_power_off = xen_power_off;
+	register_platform_power_off(xen_power_off);
 	register_restart_handler(&xen_restart_nb);
 	if (!xen_initial_domain()) {
 		struct timespec64 ts;
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 3/7] ARM: orion5x: Switch to new sys-off handler API
  2024-07-29 12:35 ` [PATCH v2 3/7] ARM: orion5x: " Andrew Davis
@ 2024-09-02 14:28   ` Gregory CLEMENT
  0 siblings, 0 replies; 9+ messages in thread
From: Gregory CLEMENT @ 2024-09-02 14:28 UTC (permalink / raw)
  To: Andrew Davis, Andre Przywara, Russell King, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Andrew Lunn,
	Sebastian Hesselbarth, Daniel Mack, Haojian Zhuang,
	Robert Jarzmik
  Cc: linux-arm-kernel, linux-kernel, imx, Andrew Davis

Hi Andrew,

> Kernel now supports chained power-off handlers. Use
> register_platform_power_off() that registers a platform level power-off
> handler. Legacy pm_power_off() will be removed once all drivers and archs
> are converted to the new sys-off API.
>
> Signed-off-by: Andrew Davis <afd@ti.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Applied on mvebu/arm

Thanks,

Gregory

> ---
>  arch/arm/mach-orion5x/board-mss2.c             | 2 +-
>  arch/arm/mach-orion5x/dns323-setup.c           | 6 +++---
>  arch/arm/mach-orion5x/kurobox_pro-setup.c      | 2 +-
>  arch/arm/mach-orion5x/mv2120-setup.c           | 2 +-
>  arch/arm/mach-orion5x/net2big-setup.c          | 2 +-
>  arch/arm/mach-orion5x/terastation_pro2-setup.c | 2 +-
>  arch/arm/mach-orion5x/ts209-setup.c            | 2 +-
>  arch/arm/mach-orion5x/ts409-setup.c            | 2 +-
>  8 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm/mach-orion5x/board-mss2.c b/arch/arm/mach-orion5x/board-mss2.c
> index b0f16d223adf5..9e3d69891d2f6 100644
> --- a/arch/arm/mach-orion5x/board-mss2.c
> +++ b/arch/arm/mach-orion5x/board-mss2.c
> @@ -82,5 +82,5 @@ static void mss2_power_off(void)
>  void __init mss2_init(void)
>  {
>  	/* register mss2 specific power-off method */
> -	pm_power_off = mss2_power_off;
> +	register_platform_power_off(mss2_power_off);
>  }
> diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
> index 062109efa0ecc..fcd38ff7ca459 100644
> --- a/arch/arm/mach-orion5x/dns323-setup.c
> +++ b/arch/arm/mach-orion5x/dns323-setup.c
> @@ -700,7 +700,7 @@ static void __init dns323_init(void)
>  		if (gpio_request(DNS323_GPIO_POWER_OFF, "POWEROFF") != 0 ||
>  		    gpio_direction_output(DNS323_GPIO_POWER_OFF, 0) != 0)
>  			pr_err("DNS-323: failed to setup power-off GPIO\n");
> -		pm_power_off = dns323a_power_off;
> +		register_platform_power_off(dns323a_power_off);
>  		break;
>  	case DNS323_REV_B1:
>  		/* 5182 built-in SATA init */
> @@ -717,7 +717,7 @@ static void __init dns323_init(void)
>  		if (gpio_request(DNS323_GPIO_POWER_OFF, "POWEROFF") != 0 ||
>  		    gpio_direction_output(DNS323_GPIO_POWER_OFF, 0) != 0)
>  			pr_err("DNS-323: failed to setup power-off GPIO\n");
> -		pm_power_off = dns323b_power_off;
> +		register_platform_power_off(dns323b_power_off);
>  		break;
>  	case DNS323_REV_C1:
>  		/* 5182 built-in SATA init */
> @@ -727,7 +727,7 @@ static void __init dns323_init(void)
>  		if (gpio_request(DNS323C_GPIO_POWER_OFF, "POWEROFF") != 0 ||
>  		    gpio_direction_output(DNS323C_GPIO_POWER_OFF, 0) != 0)
>  			pr_err("DNS-323: failed to setup power-off GPIO\n");
> -		pm_power_off = dns323c_power_off;
> +		register_platform_power_off(dns323c_power_off);
>  
>  		/* Now, -this- should theoretically be done by the sata_mv driver
>  		 * once I figure out what's going on there. Maybe the behaviour
> diff --git a/arch/arm/mach-orion5x/kurobox_pro-setup.c b/arch/arm/mach-orion5x/kurobox_pro-setup.c
> index acba066180801..339b10891808f 100644
> --- a/arch/arm/mach-orion5x/kurobox_pro-setup.c
> +++ b/arch/arm/mach-orion5x/kurobox_pro-setup.c
> @@ -373,7 +373,7 @@ static void __init kurobox_pro_init(void)
>  	i2c_register_board_info(0, &kurobox_pro_i2c_rtc, 1);
>  
>  	/* register Kurobox Pro specific power-off method */
> -	pm_power_off = kurobox_pro_power_off;
> +	register_platform_power_off(kurobox_pro_power_off);
>  }
>  
>  #ifdef CONFIG_MACH_KUROBOX_PRO
> diff --git a/arch/arm/mach-orion5x/mv2120-setup.c b/arch/arm/mach-orion5x/mv2120-setup.c
> index b7327a6128353..5b0249f109cde 100644
> --- a/arch/arm/mach-orion5x/mv2120-setup.c
> +++ b/arch/arm/mach-orion5x/mv2120-setup.c
> @@ -238,7 +238,7 @@ static void __init mv2120_init(void)
>  	if (gpio_request(MV2120_GPIO_POWER_OFF, "POWEROFF") != 0 ||
>  	    gpio_direction_output(MV2120_GPIO_POWER_OFF, 1) != 0)
>  		pr_err("mv2120: failed to setup power-off GPIO\n");
> -	pm_power_off = mv2120_power_off;
> +	register_platform_power_off(mv2120_power_off);
>  }
>  
>  /* Warning: HP uses a wrong mach-type (=526) in their bootloader */
> diff --git a/arch/arm/mach-orion5x/net2big-setup.c b/arch/arm/mach-orion5x/net2big-setup.c
> index 6ad9740b426b6..4afd9b4c71a94 100644
> --- a/arch/arm/mach-orion5x/net2big-setup.c
> +++ b/arch/arm/mach-orion5x/net2big-setup.c
> @@ -423,7 +423,7 @@ static void __init net2big_init(void)
>  
>  	if (gpio_request(NET2BIG_GPIO_POWER_OFF, "power-off") == 0 &&
>  	    gpio_direction_output(NET2BIG_GPIO_POWER_OFF, 0) == 0)
> -		pm_power_off = net2big_power_off;
> +		register_platform_power_off(net2big_power_off);
>  	else
>  		pr_err("net2big: failed to configure power-off GPIO\n");
>  
> diff --git a/arch/arm/mach-orion5x/terastation_pro2-setup.c b/arch/arm/mach-orion5x/terastation_pro2-setup.c
> index 23a5521c68336..a9f01859d1012 100644
> --- a/arch/arm/mach-orion5x/terastation_pro2-setup.c
> +++ b/arch/arm/mach-orion5x/terastation_pro2-setup.c
> @@ -349,7 +349,7 @@ static void __init tsp2_init(void)
>  	i2c_register_board_info(0, &tsp2_i2c_rtc, 1);
>  
>  	/* register Terastation Pro II specific power-off method */
> -	pm_power_off = tsp2_power_off;
> +	register_platform_power_off(tsp2_power_off);
>  }
>  
>  MACHINE_START(TERASTATION_PRO2, "Buffalo Terastation Pro II/Live")
> diff --git a/arch/arm/mach-orion5x/ts209-setup.c b/arch/arm/mach-orion5x/ts209-setup.c
> index bab8ba0e01ab9..de9092e992c56 100644
> --- a/arch/arm/mach-orion5x/ts209-setup.c
> +++ b/arch/arm/mach-orion5x/ts209-setup.c
> @@ -314,7 +314,7 @@ static void __init qnap_ts209_init(void)
>  	i2c_register_board_info(0, &qnap_ts209_i2c_rtc, 1);
>  
>  	/* register tsx09 specific power-off method */
> -	pm_power_off = qnap_tsx09_power_off;
> +	register_platform_power_off(qnap_tsx09_power_off);
>  }
>  
>  MACHINE_START(TS209, "QNAP TS-109/TS-209")
> diff --git a/arch/arm/mach-orion5x/ts409-setup.c b/arch/arm/mach-orion5x/ts409-setup.c
> index 8131982c10d97..725688aa5cba7 100644
> --- a/arch/arm/mach-orion5x/ts409-setup.c
> +++ b/arch/arm/mach-orion5x/ts409-setup.c
> @@ -312,7 +312,7 @@ static void __init qnap_ts409_init(void)
>  	platform_device_register(&ts409_leds);
>  
>  	/* register tsx09 specific power-off method */
> -	pm_power_off = qnap_tsx09_power_off;
> +	register_platform_power_off(qnap_tsx09_power_off);
>  }
>  
>  MACHINE_START(TS409, "QNAP TS-409")
> -- 
> 2.39.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-09-02 14:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-29 12:35 [PATCH v2 0/7] Switch more ARM plats to sys-off handler API Andrew Davis
2024-07-29 12:35 ` [PATCH v2 1/7] ARM: highbank: Switch to new " Andrew Davis
2024-07-29 12:35 ` [PATCH v2 2/7] ARM: imx: " Andrew Davis
2024-07-29 12:35 ` [PATCH v2 3/7] ARM: orion5x: " Andrew Davis
2024-09-02 14:28   ` Gregory CLEMENT
2024-07-29 12:35 ` [PATCH v2 4/7] ARM: pxa: " Andrew Davis
2024-07-29 12:35 ` [PATCH v2 5/7] ARM: sa1100: " Andrew Davis
2024-07-29 12:35 ` [PATCH v2 6/7] ARM: vt8500: " Andrew Davis
2024-07-29 12:35 ` [PATCH v2 7/7] arm/xen: " Andrew Davis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).