* [PATCH] firmware: arm_scmi: convert to SYSTEM_SLEEP_PM_OPS
@ 2025-07-09 7:01 Arnd Bergmann
2025-07-09 7:04 ` Peng Fan
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Arnd Bergmann @ 2025-07-09 7:01 UTC (permalink / raw)
To: Sudeep Holla, Peng Fan
Cc: Arnd Bergmann, Cristian Marussi, arm-scmi, linux-arm-kernel,
linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/firmware/arm_scmi/scmi_power_control.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/firmware/arm_scmi/scmi_power_control.c b/drivers/firmware/arm_scmi/scmi_power_control.c
index ab0cee0d4bec..955736336061 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[] = {
@@ -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,
--
2.39.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [PATCH] firmware: arm_scmi: convert to SYSTEM_SLEEP_PM_OPS
2025-07-09 7:01 [PATCH] firmware: arm_scmi: convert to SYSTEM_SLEEP_PM_OPS Arnd Bergmann
@ 2025-07-09 7:04 ` Peng Fan
2025-07-09 11:11 ` Sudeep Holla
2025-07-11 14:51 ` Jonathan Cameron
2 siblings, 0 replies; 4+ messages in thread
From: Peng Fan @ 2025-07-09 7:04 UTC (permalink / raw)
To: Arnd Bergmann, Sudeep Holla, Nathan Chancellor
Cc: Arnd Bergmann, Cristian Marussi, arm-scmi@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
> Subject: [PATCH] firmware: arm_scmi: convert to
> SYSTEM_SLEEP_PM_OPS
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks for the fix. Nathan Chancellor posted a fix earlier, but
yours has pm_sleep_ptr which is better.
Acked-by: Peng Fan <peng.fan@nxp.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] firmware: arm_scmi: convert to SYSTEM_SLEEP_PM_OPS
2025-07-09 7:01 [PATCH] firmware: arm_scmi: convert to SYSTEM_SLEEP_PM_OPS Arnd Bergmann
2025-07-09 7:04 ` Peng Fan
@ 2025-07-09 11:11 ` Sudeep Holla
2025-07-11 14:51 ` Jonathan Cameron
2 siblings, 0 replies; 4+ messages in thread
From: Sudeep Holla @ 2025-07-09 11:11 UTC (permalink / raw)
To: Peng Fan, Arnd Bergmann
Cc: Sudeep Holla, Arnd Bergmann, Cristian Marussi, arm-scmi,
linux-arm-kernel, linux-kernel
On Wed, 09 Jul 2025 09:01:01 +0200, Arnd Bergmann wrote:
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] firmware: arm_scmi: convert to SYSTEM_SLEEP_PM_OPS
2025-07-09 7:01 [PATCH] firmware: arm_scmi: convert to SYSTEM_SLEEP_PM_OPS Arnd Bergmann
2025-07-09 7:04 ` Peng Fan
2025-07-09 11:11 ` Sudeep Holla
@ 2025-07-11 14:51 ` Jonathan Cameron
2 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2025-07-11 14:51 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sudeep Holla, Peng Fan, Arnd Bergmann, Cristian Marussi, arm-scmi,
linux-arm-kernel, linux-kernel
On Wed, 9 Jul 2025 09:01:01 +0200
Arnd Bergmann <arnd@kernel.org> wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/firmware/arm_scmi/scmi_power_control.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/firmware/arm_scmi/scmi_power_control.c b/drivers/firmware/arm_scmi/scmi_power_control.c
> index ab0cee0d4bec..955736336061 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)
> };
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);
>
> 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,
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-07-11 14:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-09 7:01 [PATCH] firmware: arm_scmi: convert to SYSTEM_SLEEP_PM_OPS Arnd Bergmann
2025-07-09 7:04 ` Peng Fan
2025-07-09 11:11 ` Sudeep Holla
2025-07-11 14:51 ` Jonathan Cameron
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).