Skip to contentSkip to conversation

ALSA: core: pcm: remove unnecessary CONFIG_PM_SLEEP

PATCH In review Coiby Xu 4 participants 30 messages Oct 29, 2020

Subsystems (11)
lore
Share & tools
lore

Coiby Xu

author
#0 lore raw

PATCH 1/25 ALSA: core: pcm: remove unnecessary CONFIG_PM_SLEEP

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/core/pcm.c | 2 --
 1 file changed, 2 deletions(-)
sound/core/pcm.c +0 -2
index be5714f1bb58..5a281ac92958 100644
@@ -599,7 +599,6 @@ static const struct attribute_group *pcm_dev_attr_groups[];
  * PM callbacks: we need to deal only with suspend here, as the resume is
  * triggered either from user-space or the driver's resume callback
  */
-#ifdef CONFIG_PM_SLEEP
 static int do_pcm_suspend(struct device *dev)
 {
 	struct snd_pcm_str *pstr = container_of(dev, struct snd_pcm_str, dev);
@@ -608,7 +607,6 @@ static int do_pcm_suspend(struct device *dev)
 		snd_pcm_suspend_all(pstr->pcm);
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops pcm_dev_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(do_pcm_suspend, NULL)
Signature · 1 line
2.28.0
author
#1 lore raw

PATCH 2/25 ASoC: fsl: fsl_ssi: remove unnecessary CONFIG_PM_SLEEP

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/fsl/fsl_ssi.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/fsl/fsl_ssi.c +0 -2
index 404be27c15fe..065500a4cbc1 100644
@@ -1669,7 +1669,6 @@ static int fsl_ssi_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int fsl_ssi_suspend(struct device *dev)
 {
 	struct fsl_ssi *ssi = dev_get_drvdata(dev);
@@ -1699,7 +1698,6 @@ static int fsl_ssi_resume(struct device *dev)
 
 	return regcache_sync(regs);
 }
-#endif /* CONFIG_PM_SLEEP */
 
 static const struct dev_pm_ops fsl_ssi_pm = {
 	SET_SYSTEM_SLEEP_PM_OPS(fsl_ssi_suspend, fsl_ssi_resume)
Signature · 1 line
2.28.0
author
#2 lore raw

PATCH 3/25 ASoC: fsl: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/fsl/imx-audmux.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/fsl/imx-audmux.c +0 -2
index 25c18b9e348f..6d77188a4eab 100644
@@ -349,7 +349,6 @@ static int imx_audmux_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int imx_audmux_suspend(struct device *dev)
 {
 	int i;
@@ -377,7 +376,6 @@ static int imx_audmux_resume(struct device *dev)
 
 	return 0;
 }
-#endif /* CONFIG_PM_SLEEP */
 
 static const struct dev_pm_ops imx_audmux_pm = {
 	SET_SYSTEM_SLEEP_PM_OPS(imx_audmux_suspend, imx_audmux_resume)
Signature · 7 lines
2.28.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
author
#3 lore raw

PATCH 4/25 ASoC: rockchip: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/rockchip/rockchip_pdm.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/rockchip/rockchip_pdm.c +0 -2
index 5adb293d0435..f3c19310aeeb 100644
@@ -574,7 +574,6 @@ static int rockchip_pdm_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int rockchip_pdm_suspend(struct device *dev)
 {
 	struct rk_pdm_dev *pdm = dev_get_drvdata(dev);
@@ -601,7 +600,6 @@ static int rockchip_pdm_resume(struct device *dev)
 
 	return ret;
 }
-#endif
 
 static const struct dev_pm_ops rockchip_pdm_pm_ops = {
 	SET_RUNTIME_PM_OPS(rockchip_pdm_runtime_suspend,
Signature · 7 lines
2.28.0


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
#4 lore raw

Re: [PATCH 04/25] ASoC: rockchip: remove unnecessary CONFIG_PM_SLEEP

Quoted 1 line · Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

I don't see anything in the !CONFIG_PM_CONFIG side of SET_SYSTEM_SLEEP_PM_OPS() that prevents unused function warnings for the callbacks - does this change depend on some other patch or is it just wrong?

Robin.

Quoted 26 lines
---
  sound/soc/rockchip/rockchip_pdm.c | 2 --
  1 file changed, 2 deletions(-)
sound/soc/rockchip/rockchip_pdm.c +0 -2
index 5adb293d0435..f3c19310aeeb 100644
@@ -574,7 +574,6 @@ static int rockchip_pdm_remove(struct platform_device *pdev)
  	return 0;
  }
 
-#ifdef CONFIG_PM_SLEEP
  static int rockchip_pdm_suspend(struct device *dev)
  {
  	struct rk_pdm_dev *pdm = dev_get_drvdata(dev);
@@ -601,7 +600,6 @@ static int rockchip_pdm_resume(struct device *dev)
 
  	return ret;
  }
-#endif
 
  static const struct dev_pm_ops rockchip_pdm_pm_ops = {
  	SET_RUNTIME_PM_OPS(rockchip_pdm_runtime_suspend,
author
#5 lore raw

Re: [PATCH 04/25] ASoC: rockchip: remove unnecessary CONFIG_PM_SLEEP

Quoted 8 lines · Robin Murphy
Quoted 1 line · Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

I don't see anything in the !CONFIG_PM_CONFIG side of SET_SYSTEM_SLEEP_PM_OPS() that prevents unused function warnings for the callbacks - does this change depend on some other patch or is it just wrong?

Thank you for the feedback! I'll add "__maybe_unused" in v2.

Quoted 17 lines

Robin.

Quoted 15 lines
---
 sound/soc/rockchip/rockchip_pdm.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/rockchip/rockchip_pdm.c +0 -1
index 5adb293d0435..f3c19310aeeb 100644
@@ -574,7 +574,6 @@ static int rockchip_pdm_remove(struct platform_device *pdev)
 	return 0;
 }
-#ifdef CONFIG_PM_SLEEP
 static int rockchip_pdm_suspend(struct device *dev)
 {
Quoted 8 lines

sound/soc/rockchip/rockchip_pdm.c static int rockchip_pdm_resume(struct device *dev) · line 604

Quoted 8 lines
sound/soc/rockchip/rockchip_pdm.c +0 -1
 	struct rk_pdm_dev *pdm = dev_get_drvdata(dev);
@@ -601,7 +600,6 @@ static int rockchip_pdm_resume(struct device *dev)
 	return ret;
 }
-#endif
 static const struct dev_pm_ops rockchip_pdm_pm_ops = {
 	SET_RUNTIME_PM_OPS(rockchip_pdm_runtime_suspend,
 

--
Best regards,
Coiby

author
#6 lore raw

PATCH 5/25 ASoC: img: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/img/img-i2s-in.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/img/img-i2s-in.c +0 -2
index 0843235d73c9..8364eb9c44bc 100644
@@ -545,7 +545,6 @@ static int img_i2s_in_dev_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int img_i2s_in_suspend(struct device *dev)
 {
 	struct img_i2s_in *i2s = dev_get_drvdata(dev);
@@ -592,7 +591,6 @@ static int img_i2s_in_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct of_device_id img_i2s_in_of_match[] = {
 	{ .compatible = "img,i2s-in" },
Signature · 1 line
2.28.0
author
#7 lore raw

PATCH 6/25 ASoC: img-spdif-in: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/img/img-spdif-in.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/img/img-spdif-in.c +0 -2
index 46ff8a3621d5..bb73b7fc35da 100644
@@ -823,7 +823,6 @@ static int img_spdif_in_dev_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int img_spdif_in_suspend(struct device *dev)
 {
 	struct img_spdif_in *spdif = dev_get_drvdata(dev);
@@ -863,7 +862,6 @@ static int img_spdif_in_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct of_device_id img_spdif_in_of_match[] = {
 	{ .compatible = "img,spdif-in" },
Signature · 1 line
2.28.0
author
#8 lore raw

PATCH 7/25 ASoC: img-spdif-out: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/img/img-spdif-out.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/img/img-spdif-out.c +0 -2
index b1d8e4535726..1549a8db6657 100644
@@ -419,7 +419,6 @@ static int img_spdif_out_dev_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int img_spdif_out_suspend(struct device *dev)
 {
 	struct img_spdif_out *spdif = dev_get_drvdata(dev);
@@ -458,7 +457,6 @@ static int img_spdif_out_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 static const struct of_device_id img_spdif_out_of_match[] = {
 	{ .compatible = "img,spdif-out" },
 	{}
Signature · 1 line
2.28.0
author
#9 lore raw

PATCH 8/25 ASoC: img-i2s-out: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/img/img-i2s-out.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/img/img-i2s-out.c +0 -2
index b56a18e7f3ac..7693b7fdf299 100644
@@ -551,7 +551,6 @@ static int img_i2s_out_dev_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int img_i2s_out_suspend(struct device *dev)
 {
 	struct img_i2s_out *i2s = dev_get_drvdata(dev);
@@ -598,7 +597,6 @@ static int img_i2s_out_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct of_device_id img_i2s_out_of_match[] = {
 	{ .compatible = "img,i2s-out" },
Signature · 1 line
2.28.0
author
#10 lore raw

PATCH 9/25 ASoC: tegra: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/tegra/tegra30_ahub.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/tegra/tegra30_ahub.c +0 -2
index 156e3b9d613c..9fc22d5e9f6e 100644
@@ -629,7 +629,6 @@ static int tegra30_ahub_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int tegra30_ahub_suspend(struct device *dev)
 {
 	regcache_mark_dirty(ahub->regmap_ahub);
@@ -653,7 +652,6 @@ static int tegra30_ahub_resume(struct device *dev)
 
 	return ret;
 }
-#endif
 
 static const struct dev_pm_ops tegra30_ahub_pm_ops = {
 	SET_RUNTIME_PM_OPS(tegra30_ahub_runtime_suspend,
Signature · 1 line
2.28.0
author
#11 lore raw

PATCH 10/25 ASoC: tegra: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/tegra/tegra30_i2s.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/tegra/tegra30_i2s.c +0 -2
index db5a8587bfa4..df55b90c3cf4 100644
@@ -551,7 +551,6 @@ static int tegra30_i2s_platform_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int tegra30_i2s_suspend(struct device *dev)
 {
 	struct tegra30_i2s *i2s = dev_get_drvdata(dev);
@@ -576,7 +575,6 @@ static int tegra30_i2s_resume(struct device *dev)
 
 	return ret;
 }
-#endif
 
 static const struct dev_pm_ops tegra30_i2s_pm_ops = {
 	SET_RUNTIME_PM_OPS(tegra30_i2s_runtime_suspend,
Signature · 1 line
2.28.0
author
#12 lore raw

PATCH 11/25 ASoC: hdac: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/intel/skylake/skl.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/intel/skylake/skl.c +0 -2
index 8b993722f74e..da32d68080be 100644
@@ -322,7 +322,6 @@ static int _skl_resume(struct hdac_bus *bus)
 }
 #endif
 
-#ifdef CONFIG_PM_SLEEP
 /*
  * power management
  */
@@ -400,7 +399,6 @@ static int skl_resume(struct device *dev)
 
 	return ret;
 }
-#endif /* CONFIG_PM_SLEEP */
 
 #ifdef CONFIG_PM
 static int skl_runtime_suspend(struct device *dev)
Signature · 1 line
2.28.0
author
#13 lore raw

PATCH 12/25 ASoC: stm32: sai: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/stm/stm32_sai_sub.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/stm/stm32_sai_sub.c +0 -2
index 3aa1cf262402..38dd7e30af1b 100644
@@ -1582,7 +1582,6 @@ static int stm32_sai_sub_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int stm32_sai_sub_suspend(struct device *dev)
 {
 	struct stm32_sai_sub_data *sai = dev_get_drvdata(dev);
@@ -1616,7 +1615,6 @@ static int stm32_sai_sub_resume(struct device *dev)
 
 	return ret;
 }
-#endif /* CONFIG_PM_SLEEP */
 
 static const struct dev_pm_ops stm32_sai_sub_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(stm32_sai_sub_suspend, stm32_sai_sub_resume)
Signature · 1 line
2.28.0
author
#14 lore raw

PATCH 13/25 ASoC: stm32: spdifrx: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/stm/stm32_spdifrx.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/stm/stm32_spdifrx.c +0 -2
index 1bfa3b2ba974..40262ff0c588 100644
@@ -1056,7 +1056,6 @@ static int stm32_spdifrx_probe(struct platform_device *pdev)
 
 MODULE_DEVICE_TABLE(of, stm32_spdifrx_ids);
 
-#ifdef CONFIG_PM_SLEEP
 static int stm32_spdifrx_suspend(struct device *dev)
 {
 	struct stm32_spdifrx_data *spdifrx = dev_get_drvdata(dev);
@@ -1075,7 +1074,6 @@ static int stm32_spdifrx_resume(struct device *dev)
 
 	return regcache_sync(spdifrx->regmap);
 }
-#endif /* CONFIG_PM_SLEEP */
 
 static const struct dev_pm_ops stm32_spdifrx_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(stm32_spdifrx_suspend, stm32_spdifrx_resume)
Signature · 1 line
2.28.0
author
#15 lore raw

PATCH 14/25 ASoC: stm32: i2s: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/stm/stm32_i2s.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/stm/stm32_i2s.c +0 -2
index 7c4d63c33f15..138acfb26882 100644
@@ -984,7 +984,6 @@ static int stm32_i2s_probe(struct platform_device *pdev)
 
 MODULE_DEVICE_TABLE(of, stm32_i2s_ids);
 
-#ifdef CONFIG_PM_SLEEP
 static int stm32_i2s_suspend(struct device *dev)
 {
 	struct stm32_i2s_data *i2s = dev_get_drvdata(dev);
@@ -1002,7 +1001,6 @@ static int stm32_i2s_resume(struct device *dev)
 	regcache_cache_only(i2s->regmap, false);
 	return regcache_sync(i2s->regmap);
 }
-#endif /* CONFIG_PM_SLEEP */
 
 static const struct dev_pm_ops stm32_i2s_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(stm32_i2s_suspend, stm32_i2s_resume)
Signature · 1 line
2.28.0
author
#16 lore raw

PATCH 15/25 ASoC: stm32: sai: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/stm/stm32_sai.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/stm/stm32_sai.c +0 -2
index 058757c721f0..40c9e554a3d7 100644
@@ -245,7 +245,6 @@ static int stm32_sai_probe(struct platform_device *pdev)
 	return devm_of_platform_populate(&pdev->dev);
 }
 
-#ifdef CONFIG_PM_SLEEP
 /*
  * When pins are shared by two sai sub instances, pins have to be defined
  * in sai parent node. In this case, pins state is not managed by alsa fw.
@@ -280,7 +279,6 @@ static int stm32_sai_resume(struct device *dev)
 
 	return pinctrl_pm_select_default_state(dev);
 }
-#endif /* CONFIG_PM_SLEEP */
 
 static const struct dev_pm_ops stm32_sai_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(stm32_sai_suspend, stm32_sai_resume)
Signature · 1 line
2.28.0
author
#17 lore raw

PATCH 16/25 ASoC: sirf: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/sirf/sirf-usp.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/sirf/sirf-usp.c +0 -2
index 2af0c6f14ee6..ae2890827414 100644
@@ -313,7 +313,6 @@ static int sirf_usp_pcm_runtime_resume(struct device *dev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int sirf_usp_pcm_suspend(struct device *dev)
 {
 	struct sirf_usp *usp = dev_get_drvdata(dev);
@@ -340,7 +339,6 @@ static int sirf_usp_pcm_resume(struct device *dev)
 	}
 	return 0;
 }
-#endif
 
 static const struct snd_soc_component_driver sirf_usp_component = {
 	.name		= "sirf-usp",
Signature · 1 line
2.28.0
author
#18 lore raw

PATCH 17/25 ASoC: hdac_hdmi: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/codecs/hdac_hdmi.c | 4 ----
 1 file changed, 4 deletions(-)
sound/soc/codecs/hdac_hdmi.c +0 -4
index 2c1305bf0572..92111561a041 100644
@@ -2026,7 +2026,6 @@ static void hdmi_codec_remove(struct snd_soc_component *component)
 	pm_runtime_disable(&hdev->dev);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int hdmi_codec_resume(struct device *dev)
 {
 	struct hdac_device *hdev = dev_to_hdac_dev(dev);
@@ -2049,9 +2048,6 @@ static int hdmi_codec_resume(struct device *dev)
 	hdac_hdmi_present_sense_all_pins(hdev, hdmi, false);
 	return 0;
 }
-#else
-#define hdmi_codec_resume NULL
-#endif
 
 static const struct snd_soc_component_driver hdmi_hda_codec = {
 	.probe			= hdmi_codec_probe,
Signature · 1 line
2.28.0
author
#19 lore raw

PATCH 18/25 ASoC: codecs: max98373: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/codecs/max98373-i2c.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/codecs/max98373-i2c.c +0 -2
index 92921e34f948..f847e7e76635 100644
@@ -468,7 +468,6 @@ static struct snd_soc_dai_driver max98373_dai[] = {
 	}
 };
 
-#ifdef CONFIG_PM_SLEEP
 static int max98373_suspend(struct device *dev)
 {
 	struct max98373_priv *max98373 = dev_get_drvdata(dev);
@@ -487,7 +486,6 @@ static int max98373_resume(struct device *dev)
 	regcache_sync(max98373->regmap);
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops max98373_pm = {
 	SET_SYSTEM_SLEEP_PM_OPS(max98373_suspend, max98373_resume)
Signature · 1 line
2.28.0
author
#20 lore raw

PATCH 19/25 ASoC: sirf-audio: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/codecs/sirf-audio-codec.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/codecs/sirf-audio-codec.c +0 -2
index a061d78473ac..b6a101ec6e7c 100644
@@ -522,7 +522,6 @@ static int sirf_audio_codec_driver_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int sirf_audio_codec_suspend(struct device *dev)
 {
 	struct sirf_audio_codec *sirf_audio_codec = dev_get_drvdata(dev);
@@ -552,7 +551,6 @@ static int sirf_audio_codec_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops sirf_audio_codec_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(sirf_audio_codec_suspend, sirf_audio_codec_resume)
Signature · 1 line
2.28.0
author
#21 lore raw

PATCH 20/25 ASoC: max98390: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/codecs/max98390.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/codecs/max98390.c +0 -2
index ff5cc9bbec29..50b37e39bb6d 100644
@@ -889,7 +889,6 @@ static int max98390_probe(struct snd_soc_component *component)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int max98390_suspend(struct device *dev)
 {
 	struct max98390_priv *max98390 = dev_get_drvdata(dev);
@@ -913,7 +912,6 @@ static int max98390_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops max98390_pm = {
 	SET_SYSTEM_SLEEP_PM_OPS(max98390_suspend, max98390_resume)
Signature · 1 line
2.28.0
author
#22 lore raw

PATCH 21/25 ASoC: codecs: max98090: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/codecs/max98090.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/codecs/max98090.c +0 -2
index 945a79e4f3eb..97175d7c99cc 100644
@@ -2636,7 +2636,6 @@ static int max98090_runtime_suspend(struct device *dev)
 }
 #endif
 
-#ifdef CONFIG_PM_SLEEP
 static int max98090_resume(struct device *dev)
 {
 	struct max98090_priv *max98090 = dev_get_drvdata(dev);
@@ -2653,7 +2652,6 @@ static int max98090_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops max98090_pm = {
 	SET_RUNTIME_PM_OPS(max98090_runtime_suspend,
Signature · 1 line
2.28.0
author
#23 lore raw

PATCH 22/25 ASoC: max98927: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/codecs/max98927.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/codecs/max98927.c +0 -2
index 8b206ee77709..48c6aa78a410 100644
@@ -794,7 +794,6 @@ static int max98927_probe(struct snd_soc_component *component)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int max98927_suspend(struct device *dev)
 {
 	struct max98927_priv *max98927 = dev_get_drvdata(dev);
@@ -813,7 +812,6 @@ static int max98927_resume(struct device *dev)
 	regcache_sync(max98927->regmap);
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops max98927_pm = {
 	SET_SYSTEM_SLEEP_PM_OPS(max98927_suspend, max98927_resume)
Signature · 1 line
2.28.0
author
#24 lore raw

PATCH 23/25 ASoC: ts3a227e: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/codecs/ts3a227e.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/codecs/ts3a227e.c +0 -2
index 3ed3b45fa7ba..95d17cf7695a 100644
@@ -334,7 +334,6 @@ static int ts3a227e_i2c_probe(struct i2c_client *i2c,
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int ts3a227e_suspend(struct device *dev)
 {
 	struct ts3a227e *ts3a227e = dev_get_drvdata(dev);
@@ -354,7 +353,6 @@ static int ts3a227e_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops ts3a227e_pm = {
 	SET_SYSTEM_SLEEP_PM_OPS(ts3a227e_suspend, ts3a227e_resume)
Signature · 1 line
2.28.0
#25 lore raw
In reply to Coiby Xu
Quoted 4 lines · Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

It caused compile warnings. Was it already addressed in general?

Or we may use __maybe_unused attribute instead, but it's just a matter of taste.

thanks,

Takashi

Quoted 27 lines
---
 sound/core/pcm.c | 2 --
 1 file changed, 2 deletions(-)
sound/core/pcm.c +0 -2
index be5714f1bb58..5a281ac92958 100644
@@ -599,7 +599,6 @@ static const struct attribute_group *pcm_dev_attr_groups[];
  * PM callbacks: we need to deal only with suspend here, as the resume is
  * triggered either from user-space or the driver's resume callback
  */
-#ifdef CONFIG_PM_SLEEP
 static int do_pcm_suspend(struct device *dev)
 {
 	struct snd_pcm_str *pstr = container_of(dev, struct snd_pcm_str, dev);
@@ -608,7 +607,6 @@ static int do_pcm_suspend(struct device *dev)
 		snd_pcm_suspend_all(pstr->pcm);
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops pcm_dev_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(do_pcm_suspend, NULL)
Signature · 1 line
2.28.0
author
#26 lore raw
Quoted 9 lines · Takashi Iwai
Quoted 4 lines · Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

It caused compile warnings. Was it already addressed in general?

It hasn't been addressed in general. Thank you for the reminding!

Quoted 3 lines

Or we may use __maybe_unused attribute instead, but it's just a matter of taste.

I'll add __maybe_unused in v2 since __maybe_unused should be preferred over CONFIG_PM_SLEEP according to Arnd Bergmann [1],

Quoted 22 lines
Quoted 4 lines

By and large, drivers handle this by using a CONFIG_PM_SLEEP ifdef.

Unless you can make an extremely convincing argument why not to do so here, I'd like you to handle it that way instead.

[adding linux-pm to Cc]

The main reason is that everyone gets the #ifdef wrong, I run into half a dozen new build regressions with linux-next every week on average, the typical problems being:

- testing CONFIG_PM_SLEEP instead of CONFIG_PM, leading to an unused function warning
- testing CONFIG_PM instead of CONFIG_PM_SLEEP, leading to a build failure
- calling a function outside of the #ifdef only from inside an otherwise correct #ifdef, again leading to an unused function warning
- causing a warning inside of the #ifdef but only testing if that is disabled, leading to a problem if the macro is set (this is rare these days for CONFIG_PM as that is normally enabled)

Quoted 1 line

Using __maybe_unused avoids all of the above.

[1] https://lore.kernel.org/patchwork/comment/919944/

Quoted 27 lines

thanks,

Takashi

Quoted 22 lines
---
 sound/core/pcm.c | 2 --
 1 file changed, 2 deletions(-)
sound/core/pcm.c +0 -2
index be5714f1bb58..5a281ac92958 100644
@@ -599,7 +599,6 @@ static const struct attribute_group *pcm_dev_attr_groups[];
  * PM callbacks: we need to deal only with suspend here, as the resume is
  * triggered either from user-space or the driver's resume callback
  */
-#ifdef CONFIG_PM_SLEEP
 static int do_pcm_suspend(struct device *dev)
 {
 	struct snd_pcm_str *pstr = container_of(dev, struct snd_pcm_str, dev);
@@ -608,7 +607,6 @@ static int do_pcm_suspend(struct device *dev)
 		snd_pcm_suspend_all(pstr->pcm);
 	return 0;
 }
-#endif
 
Quoted 5 lines
Quoted 5 lines
sound/core/pcm.c +0 -1
 static const struct dev_pm_ops pcm_dev_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(do_pcm_suspend, NULL)
--

2.28.0

--
Best regards,
Coiby

author
#27 lore raw

PATCH 24/25 ASoC: wm8994: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/codecs/wm8994.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/codecs/wm8994.c +0 -2
index fc9ea198ac79..9294ad06f76d 100644
@@ -4656,7 +4656,6 @@ static int wm8994_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int wm8994_suspend(struct device *dev)
 {
 	struct wm8994_priv *wm8994 = dev_get_drvdata(dev);
@@ -4681,7 +4680,6 @@ static int wm8994_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops wm8994_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(wm8994_suspend, wm8994_resume)
Signature · 1 line
2.28.0
#28 lore raw

Re: [PATCH 24/25] ASoC: wm8994: remove unnecessary CONFIG_PM_SLEEP

Quoted 20 lines · Coiby Xu

SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/soc/codecs/wm8994.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/codecs/wm8994.c +0 -1
index fc9ea198ac79..9294ad06f76d 100644
@@ -4656,7 +4656,6 @@ static int wm8994_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int wm8994_suspend(struct device *dev)
 {
 	struct wm8994_priv *wm8994 = dev_get_drvdata(dev);

sound/soc/codecs/wm8994.c static int wm8994_resume(struct device *dev) · line 4685

Quoted 7 lines
sound/soc/codecs/wm8994.c +0 -1
@@ -4681,7 +4680,6 @@ static int wm8994_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops wm8994_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(wm8994_suspend, wm8994_resume)

Not sure this really makes sense, what is going to stop the unused function warning if PM isn't configured?

Thanks,
Charles

author
#29 lore raw

PATCH 25/25 ALSA: aoa: remove unnecessary CONFIG_PM_SLEEP

In reply to Coiby Xu

SIMPLE_DEV_PM_OPS has already took good care of CONFIG_PM_CONFIG.

---
 sound/aoa/fabrics/layout.c | 4 ----
 1 file changed, 4 deletions(-)
sound/aoa/fabrics/layout.c +0 -4
index d2e85b83f7ed..197d13f23141 100644
@@ -1126,7 +1126,6 @@ static int aoa_fabric_layout_remove(struct soundbus_dev *sdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int aoa_fabric_layout_suspend(struct device *dev)
 {
 	struct layout_dev *ldev = dev_get_drvdata(dev);
@@ -1150,7 +1149,6 @@ static int aoa_fabric_layout_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(aoa_fabric_layout_pm_ops,
 	aoa_fabric_layout_suspend, aoa_fabric_layout_resume);
 
-#endif
 
 static struct soundbus_driver aoa_soundbus_driver = {
 	.name = "snd_aoa_soundbus_drv",
@@ -1159,9 +1157,7 @@ static struct soundbus_driver aoa_soundbus_driver = {
 	.remove = aoa_fabric_layout_remove,
 	.driver = {
 		.owner = THIS_MODULE,
-#ifdef CONFIG_PM_SLEEP
 		.pm = &aoa_fabric_layout_pm_ops,
-#endif
 	}
 };
 
Signature · 1 line
2.28.0