[PATCH] firmware: arm_scmi: Use modern PM ops

Nathan Chancellor posted 1 patch 3 months ago
drivers/firmware/arm_scmi/scmi_power_control.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] firmware: arm_scmi: Use modern PM ops
Posted by Nathan Chancellor 3 months ago
When building without CONFIG_PM_SLEEP (e.g., with hexagon or s390),
there is a warning because scmi_system_power_resume() is not used due to
how SET_SYSTEM_SLEEP_PM_OPS is defined:

  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)
        |            ^~~~~~~~~~~~~~~~~~~~~~~~

Use the moderm SYSTEM_SLEEP_PM_OPS to resolve the warnings, which is
what SET_SYSTEM_SLEEP_PM_OPS ultimately expands to, so there is no
change in behavior.

Fixes: 9a0658d3991e ("firmware: arm_scmi: power_control: Ensure SCMI_SYSPOWER_IDLE is set early during resume")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 drivers/firmware/arm_scmi/scmi_power_control.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/arm_scmi/scmi_power_control.c b/drivers/firmware/arm_scmi/scmi_power_control.c
index ab0cee0d4bec..04202ff8094d 100644
--- a/drivers/firmware/arm_scmi/scmi_power_control.c
+++ b/drivers/firmware/arm_scmi/scmi_power_control.c
@@ -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[] = {

---
base-commit: 990e0418abe33d34e51a04cd7a71c2e044985836
change-id: 20250708-arm-scmi-modern-pm-ops-9c4e69c39698

Best regards,
--  
Nathan Chancellor <nathan@kernel.org>
Re: [PATCH] firmware: arm_scmi: Use modern PM ops
Posted by Sudeep Holla 3 months ago
On Tue, Jul 08, 2025 at 04:19:50PM -0700, Nathan Chancellor wrote:
> When building without CONFIG_PM_SLEEP (e.g., with hexagon or s390),
> there is a warning because scmi_system_power_resume() is not used due to
> how SET_SYSTEM_SLEEP_PM_OPS is defined:
> 
>   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)
>         |            ^~~~~~~~~~~~~~~~~~~~~~~~
> 
> Use the moderm SYSTEM_SLEEP_PM_OPS to resolve the warnings, which is
> what SET_SYSTEM_SLEEP_PM_OPS ultimately expands to, so there is no
> change in behavior.
> 

If it is OK, I plan to pick [1] which additional uses pm_sleep_ptr()
to avoid additional warnings.

-- 
Regards,
Sudeep

[1] https://lore.kernel.org/all/20250709070107.1388512-1-arnd@kernel.org