[PATCH] ASoC: da7219: scope AAD suspend and resume helpers to CONFIG_PM

Pengpeng Hou posted 1 patch 1 month ago
There is a newer version of this series
[PATCH] ASoC: da7219: scope AAD suspend and resume helpers to CONFIG_PM
Posted by Pengpeng Hou 1 month ago
From: pengpeng.hou@isrc.iscas.ac.cn

In current linux.git (1954c4f01220), da7219_aad_suspend() and
da7219_aad_resume() are defined and declared unconditionally. However,
their only in-tree callers are the component PM callbacks in da7219.c,
which are already guarded by #ifdef CONFIG_PM.

This inconsistency leads to unnecessary code inclusion and potential
compiler warnings when CONFIG_PM is disabled. Match the helper
declarations and definitions to the callers' scope and provide no-op
!CONFIG_PM stubs in the header.

Signed-off-by: pengpeng@iscas.ac.cn
---
diff --git a/sound/soc/codecs/da7219-aad.c b/sound/soc/codecs/da7219-aad.c
--- a/sound/soc/codecs/da7219-aad.c
+++ b/sound/soc/codecs/da7219-aad.c
@@
 /*
  * Suspend/Resume
  */
 
+#ifdef CONFIG_PM
 void da7219_aad_suspend(struct snd_soc_component *component)
 {
 	struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component);
@@
 			da7219_aad->micbias_resume_enable = false;
 		}
 	}
 }
+#endif
 
 /*
  * Init/Exit
  */
diff --git a/sound/soc/codecs/da7219-aad.h b/sound/soc/codecs/da7219-aad.h
--- a/sound/soc/codecs/da7219-aad.h
+++ b/sound/soc/codecs/da7219-aad.h
@@
 void da7219_aad_jack_det(struct snd_soc_component *component, struct snd_soc_jack *jack);
 
 /* Suspend/Resume */
+#ifdef CONFIG_PM
 void da7219_aad_suspend(struct snd_soc_component *component);
 void da7219_aad_resume(struct snd_soc_component *component);
+#else
+static inline void da7219_aad_suspend(struct snd_soc_component *component) { }
+static inline void da7219_aad_resume(struct snd_soc_component *component) { }
+#endif
 
 /* Init/Exit */
 int da7219_aad_init(struct snd_soc_component *component);
Re: [PATCH] ASoC: da7219: scope AAD suspend and resume helpers to CONFIG_PM
Posted by Mark Brown 1 month ago
On Mon, 09 Mar 2026 08:28:24 +0000, Pengpeng Hou wrote:
> In current linux.git (1954c4f01220), da7219_aad_suspend() and
> da7219_aad_resume() are defined and declared unconditionally. However,
> their only in-tree callers are the component PM callbacks in da7219.c,
> which are already guarded by #ifdef CONFIG_PM.
> 
> This inconsistency leads to unnecessary code inclusion and potential
> compiler warnings when CONFIG_PM is disabled. Match the helper
> declarations and definitions to the callers' scope and provide no-op
> !CONFIG_PM stubs in the header.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: da7219: scope AAD suspend and resume helpers to CONFIG_PM
      commit: 4ba5c63778e5cca15b1408f012d00b441f808f3d

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
Re: [PATCH] ASoC: da7219: scope AAD suspend and resume helpers to CONFIG_PM
Posted by Mark Brown 1 month ago
On Mon, Mar 09, 2026 at 08:28:24AM +0000, Pengpeng Hou wrote:
> From: pengpeng.hou@isrc.iscas.ac.cn
> 
> In current linux.git (1954c4f01220), da7219_aad_suspend() and
> da7219_aad_resume() are defined and declared unconditionally. However,
> their only in-tree callers are the component PM callbacks in da7219.c,
> which are already guarded by #ifdef CONFIG_PM.

This doesn't apply against current code, please check and resend.