Skip to contentSkip to conversation

firmware: arm_scmi: convert to SYSTEM_SLEEP_PM_OPS

PATCH Applied Arnd Bergmann 4 participants 4 messages Jul 9, 2025 – Jul 11, 2025 System control & power/management interface (SCPI/SCMI) Message Protocol drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 firmware: arm_scmi: convert to SYSTEM_SLEEP_PM_OPS

From: Arnd Bergmann <[email protected]>

The old SET_SYSTEM_SLEEP_PM_OPS() macro leads to a warning about an unused function:

drivers/firmware/arm_scmi/scmi_power_control.c:363:12: error: 'scmi_system_power_resume' defined but not used [-Werror=unused-function]
363 | static int scmi_system_power_resume(struct device *dev)

The proper way to do this these days is to use SYSTEM_SLEEP_PM_OPS() and pm_sleep_ptr().

Fixes 9a0658d3991e ("firmware: arm_scmi: power_control: Ensure SCMI_SYSPOWER_IDLE is set early during resume")
---
 drivers/firmware/arm_scmi/scmi_power_control.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/firmware/arm_scmi/scmi_power_control.c +2 -2
index ab0cee0d4bec..955736336061 100644
@@ -369,7 +369,7 @@ static int scmi_system_power_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops scmi_system_power_pmops = {
-	SET_SYSTEM_SLEEP_PM_OPS(NULL, scmi_system_power_resume)
+	SYSTEM_SLEEP_PM_OPS(NULL, scmi_system_power_resume)
 };
 
 static const struct scmi_device_id scmi_id_table[] = {
@@ -380,7 +380,7 @@ MODULE_DEVICE_TABLE(scmi, scmi_id_table);
 
 static struct scmi_driver scmi_system_power_driver = {
 	.driver	= {
-		.pm = &scmi_system_power_pmops,
+		.pm = pm_sleep_ptr(&scmi_system_power_pmops),
 	},
 	.name = "scmi-system-power",
 	.probe = scmi_syspower_probe,
Signature · 1 line
2.39.5
Acked-by on v1 1/1
#1 lore raw
Quoted 13 lines

Subject: [PATCH] firmware: arm_scmi: convert to
SYSTEM_SLEEP_PM_OPS

From: Arnd Bergmann <[email protected]>

The old SET_SYSTEM_SLEEP_PM_OPS() macro leads to a warning about an unused function:

drivers/firmware/arm_scmi/scmi_power_control.c:363:12: error:
'scmi_system_power_resume' defined but not used [-Werror=unused- function]
363 | static int scmi_system_power_resume(struct device *dev)

Quoted 6 lines

The proper way to do this these days is to use
SYSTEM_SLEEP_PM_OPS() and pm_sleep_ptr().

Fixes 9a0658d3991e ("firmware: arm_scmi: power_control: Ensure

SCMI_SYSPOWER_IDLE is set early during resume")

Thanks for the fix. Nathan Chancellor posted a fix earlier, but yours has pm_sleep_ptr which is better.

Applied
#2 lore raw
In reply to Arnd Bergmann
Quoted 10 lines · Arnd Bergmann

The old SET_SYSTEM_SLEEP_PM_OPS() macro leads to a warning about an unused function:

drivers/firmware/arm_scmi/scmi_power_control.c:363:12: error: 'scmi_system_power_resume' defined but not used [-Werror=unused-function]
363 | static int scmi_system_power_resume(struct device *dev)

The proper way to do this these days is to use SYSTEM_SLEEP_PM_OPS() and pm_sleep_ptr().

[...]

Applied to sudeep.holla/linux (for-next/scmi/updates), thanks!

[1/1] firmware: arm_scmi: convert to SYSTEM_SLEEP_PM_OPS

      https://git.kernel.org/sudeep.holla/c/62d6b81e8bd2

--
Regards,
Sudeep

#3 lore raw
In reply to Arnd Bergmann
Quoted 22 lines · On Wed, 9 Jul 2025 09:01:01 +0200 Arnd Bergmann <[email protected]> wrote:

From: Arnd Bergmann <[email protected]>

The old SET_SYSTEM_SLEEP_PM_OPS() macro leads to a warning about an unused function:

drivers/firmware/arm_scmi/scmi_power_control.c:363:12: error: 'scmi_system_power_resume' defined but not used [-Werror=unused-function]
363 | static int scmi_system_power_resume(struct device *dev)

The proper way to do this these days is to use SYSTEM_SLEEP_PM_OPS() and pm_sleep_ptr().

Fixes 9a0658d3991e ("firmware: arm_scmi: power_control: Ensure SCMI_SYSPOWER_IDLE is set early during resume")
---
 drivers/firmware/arm_scmi/scmi_power_control.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/firmware/arm_scmi/scmi_power_control.c +0 -0
index ab0cee0d4bec..955736336061 100644

drivers/firmware/arm_scmi/scmi_power_control.c static int scmi_system_power_resume(struct device *dev) · line 373

Quoted 6 lines
drivers/firmware/arm_scmi/scmi_power_control.c +1 -1
@@ -369,7 +369,7 @@ static int scmi_system_power_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops scmi_system_power_pmops = {
-	SET_SYSTEM_SLEEP_PM_OPS(NULL, scmi_system_power_resume)
+	SYSTEM_SLEEP_PM_OPS(NULL, scmi_system_power_resume)
 };

As a possible followup IIRC we have a macro for this

static DEFINE_SIMPLE_DEV_PM_OPS(scmi_system_power_pmops,

				NULL, scmi_system_power_resume);
Quoted 11 lines
drivers/firmware/arm_scmi/scmi_power_control.c +1 -1
 static const struct scmi_device_id scmi_id_table[] = {
@@ -380,7 +380,7 @@ MODULE_DEVICE_TABLE(scmi, scmi_id_table);
 
 static struct scmi_driver scmi_system_power_driver = {
 	.driver	= {
-		.pm = &scmi_system_power_pmops,
+		.pm = pm_sleep_ptr(&scmi_system_power_pmops),
 	},
 	.name = "scmi-system-power",
 	.probe = scmi_syspower_probe,