linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda: cix-ipbloq: Use modern PM ops
@ 2025-12-11  1:50 Nathan Chancellor
  2025-12-11  8:45 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2025-12-11  1:50 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Joakim Zhang
  Cc: Peter Chen, Fugang Duan, CIX Linux Kernel Upstream Group,
	linux-sound, linux-arm-kernel, Nathan Chancellor

When building without CONFIG_PM_SLEEP, there are several warnings (or
errors with CONFIG_WERROR=y / W=e) from the cix-ipbloq driver:

  sound/hda/controllers/cix-ipbloq.c:378:12: error: 'cix_ipbloq_hda_runtime_resume' defined but not used [-Werror=unused-function]
    378 | static int cix_ipbloq_hda_runtime_resume(struct device *dev)
        |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  sound/hda/controllers/cix-ipbloq.c:362:12: error: 'cix_ipbloq_hda_runtime_suspend' defined but not used [-Werror=unused-function]
    362 | static int cix_ipbloq_hda_runtime_suspend(struct device *dev)
        |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  sound/hda/controllers/cix-ipbloq.c:349:12: error: 'cix_ipbloq_hda_resume' defined but not used [-Werror=unused-function]
    349 | static int cix_ipbloq_hda_resume(struct device *dev)
        |            ^~~~~~~~~~~~~~~~~~~~~
  sound/hda/controllers/cix-ipbloq.c:336:12: error: 'cix_ipbloq_hda_suspend' defined but not used [-Werror=unused-function]
    336 | static int cix_ipbloq_hda_suspend(struct device *dev)
        |            ^~~~~~~~~~~~~~~~~~~~~~

When CONFIG_PM and CONFIG_PM_SLEEP are unset, SET_SYSTEM_SLEEP_PM_OPS()
and SET_RUNTIME_PM_OPS() evaluate to nothing, so these functions appear
unused to the compiler in this configuration.

Use the modern SYSTEM_SLEEP_PM_OPS and RUNTIME_PM_OPS macros to resolve
these warnings, which is what they are intended to do. Additionally,
wrap &cix_ipbloq_hda_pm in pm_ptr() to ensure the compiler can drop the
entire structure when CONFIG_PM is unset.

Fixes: d91e9bd10125 ("ALSA: hda: add CIX IPBLOQ HDA controller support")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 sound/hda/controllers/cix-ipbloq.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/sound/hda/controllers/cix-ipbloq.c b/sound/hda/controllers/cix-ipbloq.c
index cc9153692ef5..99f9f48e91d4 100644
--- a/sound/hda/controllers/cix-ipbloq.c
+++ b/sound/hda/controllers/cix-ipbloq.c
@@ -407,10 +407,10 @@ static int cix_ipbloq_hda_runtime_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops cix_ipbloq_hda_pm = {
-	SET_SYSTEM_SLEEP_PM_OPS(cix_ipbloq_hda_suspend,
-				cix_ipbloq_hda_resume)
-	SET_RUNTIME_PM_OPS(cix_ipbloq_hda_runtime_suspend,
-			   cix_ipbloq_hda_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(cix_ipbloq_hda_suspend,
+			    cix_ipbloq_hda_resume)
+	RUNTIME_PM_OPS(cix_ipbloq_hda_runtime_suspend,
+		       cix_ipbloq_hda_runtime_resume, NULL)
 };
 
 static const struct of_device_id cix_ipbloq_hda_match[] = {
@@ -422,7 +422,7 @@ MODULE_DEVICE_TABLE(of, cix_ipbloq_hda_match);
 static struct platform_driver cix_ipbloq_hda_driver = {
 	.driver = {
 		.name = "cix-ipbloq-hda",
-		.pm = &cix_ipbloq_hda_pm,
+		.pm = pm_ptr(&cix_ipbloq_hda_pm),
 		.of_match_table = cix_ipbloq_hda_match,
 	},
 	.probe = cix_ipbloq_hda_probe,

---
base-commit: 161a0c617ab172bbcda7ce61803addeb2124dbff
change-id: 20251211-hda-cix-ipbloq-modern-pm-ops-a6b6754bf170

Best regards,
--  
Nathan Chancellor <nathan@kernel.org>



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

* Re: [PATCH] ALSA: hda: cix-ipbloq: Use modern PM ops
  2025-12-11  1:50 [PATCH] ALSA: hda: cix-ipbloq: Use modern PM ops Nathan Chancellor
@ 2025-12-11  8:45 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2025-12-11  8:45 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Jaroslav Kysela, Takashi Iwai, Joakim Zhang, Peter Chen,
	Fugang Duan, CIX Linux Kernel Upstream Group, linux-sound,
	linux-arm-kernel

On Thu, 11 Dec 2025 02:50:03 +0100,
Nathan Chancellor wrote:
> 
> When building without CONFIG_PM_SLEEP, there are several warnings (or
> errors with CONFIG_WERROR=y / W=e) from the cix-ipbloq driver:
> 
>   sound/hda/controllers/cix-ipbloq.c:378:12: error: 'cix_ipbloq_hda_runtime_resume' defined but not used [-Werror=unused-function]
>     378 | static int cix_ipbloq_hda_runtime_resume(struct device *dev)
>         |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   sound/hda/controllers/cix-ipbloq.c:362:12: error: 'cix_ipbloq_hda_runtime_suspend' defined but not used [-Werror=unused-function]
>     362 | static int cix_ipbloq_hda_runtime_suspend(struct device *dev)
>         |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   sound/hda/controllers/cix-ipbloq.c:349:12: error: 'cix_ipbloq_hda_resume' defined but not used [-Werror=unused-function]
>     349 | static int cix_ipbloq_hda_resume(struct device *dev)
>         |            ^~~~~~~~~~~~~~~~~~~~~
>   sound/hda/controllers/cix-ipbloq.c:336:12: error: 'cix_ipbloq_hda_suspend' defined but not used [-Werror=unused-function]
>     336 | static int cix_ipbloq_hda_suspend(struct device *dev)
>         |            ^~~~~~~~~~~~~~~~~~~~~~
> 
> When CONFIG_PM and CONFIG_PM_SLEEP are unset, SET_SYSTEM_SLEEP_PM_OPS()
> and SET_RUNTIME_PM_OPS() evaluate to nothing, so these functions appear
> unused to the compiler in this configuration.
> 
> Use the modern SYSTEM_SLEEP_PM_OPS and RUNTIME_PM_OPS macros to resolve
> these warnings, which is what they are intended to do. Additionally,
> wrap &cix_ipbloq_hda_pm in pm_ptr() to ensure the compiler can drop the
> entire structure when CONFIG_PM is unset.
> 
> Fixes: d91e9bd10125 ("ALSA: hda: add CIX IPBLOQ HDA controller support")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Applied now.  Thanks.


Takashi


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

end of thread, other threads:[~2025-12-11  8:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-11  1:50 [PATCH] ALSA: hda: cix-ipbloq: Use modern PM ops Nathan Chancellor
2025-12-11  8:45 ` Takashi Iwai

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).