[PATCH v3 2/3] ARM: at91: Move PM init functions to .init_late hook

Rob Herring (Arm)
2026-01-05T21:07:05Z

Move the AT91 PM init functions to .init_late hook to ensure driver
dependencies have probed.

Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Tested-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
v3:
- Fix author name adding "(Arm)"
- Fixup split between patch 2 and 3

v2:
- new patch
---
arch/arm/mach-at91/at91rm9200.c | 3 +--
arch/arm/mach-at91/at91sam9.c | 3 +--
arch/arm/mach-at91/sam9x60.c | 3 +--
arch/arm/mach-at91/sam9x7.c | 3 +--
arch/arm/mach-at91/sama5.c | 5 +++--
arch/arm/mach-at91/sama7.c | 2 +-
6 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 4f8186211619..2ac564eb8bbb 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -17,8 +17,6 @@
static void __init at91rm9200_dt_device_init(void)
{
of_platform_default_populate(NULL, NULL, NULL);
-
- at91rm9200_pm_init();
}

static const char *const at91rm9200_dt_board_compat[] __initconst = {
@@ -27,6 +25,7 @@ static const char *const at91rm9200_dt_board_compat[] __initconst = {
};

DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200")
+ .init_late = at91rm9200_pm_init,
.init_machine = at91rm9200_dt_device_init,
.dt_compat = at91rm9200_dt_board_compat,
MACHINE_END
diff --git a/arch/arm/mach-at91/at91sam9.c b/arch/arm/mach-at91/at91sam9.c
index 7e572189a5eb..cf07cba4ee5d 100644
--- a/arch/arm/mach-at91/at91sam9.c
+++ b/arch/arm/mach-at91/at91sam9.c
@@ -17,8 +17,6 @@
static void __init at91sam9_init(void)
{
of_platform_default_populate(NULL, NULL, NULL);
-
- at91sam9_pm_init();
}

static const char *const at91_dt_board_compat[] __initconst = {
@@ -28,6 +26,7 @@ static const char *const at91_dt_board_compat[] __initconst = {

DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM9")
/* Maintainer: Atmel */
+ .init_late = at91sam9_pm_init,
.init_machine = at91sam9_init,
.dt_compat = at91_dt_board_compat,
MACHINE_END
diff --git a/arch/arm/mach-at91/sam9x60.c b/arch/arm/mach-at91/sam9x60.c
index d8c739d25458..a31beaaeffcd 100644
--- a/arch/arm/mach-at91/sam9x60.c
+++ b/arch/arm/mach-at91/sam9x60.c
@@ -18,8 +18,6 @@
static void __init sam9x60_init(void)
{
of_platform_default_populate(NULL, NULL, NULL);
-
- sam9x60_pm_init();
}

static const char *const sam9x60_dt_board_compat[] __initconst = {
@@ -29,6 +27,7 @@ static const char *const sam9x60_dt_board_compat[] __initconst = {

DT_MACHINE_START(sam9x60_dt, "Microchip SAM9X60")
/* Maintainer: Microchip */
+ .init_late = sam9x60_pm_init,
.init_machine = sam9x60_init,
.dt_compat = sam9x60_dt_board_compat,
MACHINE_END
diff --git a/arch/arm/mach-at91/sam9x7.c b/arch/arm/mach-at91/sam9x7.c
index e1ff30b5b09b..0c73f7fefd4f 100644
--- a/arch/arm/mach-at91/sam9x7.c
+++ b/arch/arm/mach-at91/sam9x7.c
@@ -17,8 +17,6 @@
static void __init sam9x7_init(void)
{
of_platform_default_populate(NULL, NULL, NULL);
-
- sam9x7_pm_init();
}

static const char * const sam9x7_dt_board_compat[] __initconst = {
@@ -28,6 +26,7 @@ static const char * const sam9x7_dt_board_compat[] __initconst = {

DT_MACHINE_START(sam9x7_dt, "Microchip SAM9X7")
/* Maintainer: Microchip */
+ .init_late = sam9x7_pm_init,
.init_machine = sam9x7_init,
.dt_compat = sam9x7_dt_board_compat,
MACHINE_END
diff --git a/arch/arm/mach-at91/sama5.c b/arch/arm/mach-at91/sama5.c
index bf2b5c6a18c6..576654cba82d 100644
--- a/arch/arm/mach-at91/sama5.c
+++ b/arch/arm/mach-at91/sama5.c
@@ -33,7 +33,6 @@ static void __init sama5_secure_cache_init(void)
static void __init sama5_dt_device_init(void)
{
of_platform_default_populate(NULL, NULL, NULL);
- sama5_pm_init();
}

static const char *const sama5_dt_board_compat[] __initconst = {
@@ -43,6 +42,7 @@ static const char *const sama5_dt_board_compat[] __initconst = {

DT_MACHINE_START(sama5_dt, "Atmel SAMA5")
/* Maintainer: Atmel */
+ .init_late = sama5_pm_init,
.init_machine = sama5_dt_device_init,
.dt_compat = sama5_dt_board_compat,
MACHINE_END
@@ -55,6 +55,7 @@ static const char *const sama5_alt_dt_board_compat[] __initconst = {
DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5")
/* Maintainer: Atmel */
.init_machine = sama5_dt_device_init,
+ .init_late = sama5_pm_init,
.dt_compat = sama5_alt_dt_board_compat,
.l2c_aux_mask = ~0UL,
MACHINE_END
@@ -62,7 +63,6 @@ MACHINE_END
static void __init sama5d2_init(void)
{
of_platform_default_populate(NULL, NULL, NULL);
- sama5d2_pm_init();
}

static const char *const sama5d2_compat[] __initconst = {
@@ -74,6 +74,7 @@ DT_MACHINE_START(sama5d2, "Atmel SAMA5")
/* Maintainer: Atmel */
.init_machine = sama5d2_init,
.init_early = sama5_secure_cache_init,
+ .init_late = sama5d2_pm_init,
.dt_compat = sama5d2_compat,
.l2c_aux_mask = ~0UL,
MACHINE_END
diff --git a/arch/arm/mach-at91/sama7.c b/arch/arm/mach-at91/sama7.c
index bd43733ede18..8bf57a020f1c 100644
--- a/arch/arm/mach-at91/sama7.c
+++ b/arch/arm/mach-at91/sama7.c
@@ -17,7 +17,6 @@
static void __init sama7_dt_device_init(void)
{
of_platform_default_populate(NULL, NULL, NULL);
- sama7_pm_init();
}

static const char *const sama7_dt_board_compat[] __initconst = {
@@ -27,6 +26,7 @@ static const char *const sama7_dt_board_compat[] __initconst = {

DT_MACHINE_START(sama7_dt, "Microchip SAMA7")
/* Maintainer: Microchip */
+ .init_late = sama7_pm_init,
.init_machine = sama7_dt_device_init,
.dt_compat = sama7_dt_board_compat,
MACHINE_END

--
2.51.0