From: Takashi Iwai <tiwai@suse.de>
To: Mark Brown <broonie@kernel.org>
Cc: linux-sound@vger.kernel.org
Subject: [PATCH 76/89] ASoC: rockchip: Convert to RUNTIME_PM_OPS() & co
Date: Thu, 13 Mar 2025 18:41:21 +0100 [thread overview]
Message-ID: <20250313174139.29942-77-tiwai@suse.de> (raw)
In-Reply-To: <20250313174139.29942-1-tiwai@suse.de>
Use the newer RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() macros
instead of SET_RUNTIME_PM_OPS() and SET_SYSTEM_SLEEP_PM_OPS() together
with pm_ptr(), which allows us to drop ugly __maybe_unused
attributes.
This optimizes slightly when CONFIG_PM is disabled, too.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sound/soc/rockchip/rockchip_i2s.c | 5 ++---
sound/soc/rockchip/rockchip_i2s_tdm.c | 16 +++++++---------
sound/soc/rockchip/rockchip_pdm.c | 10 ++++------
sound/soc/rockchip/rockchip_spdif.c | 9 ++++-----
4 files changed, 17 insertions(+), 23 deletions(-)
diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
index 4315da4a47c1..0a0a95b4f520 100644
--- a/sound/soc/rockchip/rockchip_i2s.c
+++ b/sound/soc/rockchip/rockchip_i2s.c
@@ -860,8 +860,7 @@ static void rockchip_i2s_remove(struct platform_device *pdev)
}
static const struct dev_pm_ops rockchip_i2s_pm_ops = {
- SET_RUNTIME_PM_OPS(i2s_runtime_suspend, i2s_runtime_resume,
- NULL)
+ RUNTIME_PM_OPS(i2s_runtime_suspend, i2s_runtime_resume, NULL)
};
static struct platform_driver rockchip_i2s_driver = {
@@ -870,7 +869,7 @@ static struct platform_driver rockchip_i2s_driver = {
.driver = {
.name = DRV_NAME,
.of_match_table = of_match_ptr(rockchip_i2s_match),
- .pm = &rockchip_i2s_pm_ops,
+ .pm = pm_ptr(&rockchip_i2s_pm_ops),
},
};
module_platform_driver(rockchip_i2s_driver);
diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c
index 78ab88843f86..d9a1fab7f403 100644
--- a/sound/soc/rockchip/rockchip_i2s_tdm.c
+++ b/sound/soc/rockchip/rockchip_i2s_tdm.c
@@ -122,7 +122,7 @@ static int i2s_tdm_prepare_enable_mclk(struct rk_i2s_tdm_dev *i2s_tdm)
return ret;
}
-static int __maybe_unused i2s_tdm_runtime_suspend(struct device *dev)
+static int i2s_tdm_runtime_suspend(struct device *dev)
{
struct rk_i2s_tdm_dev *i2s_tdm = dev_get_drvdata(dev);
@@ -134,7 +134,7 @@ static int __maybe_unused i2s_tdm_runtime_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused i2s_tdm_runtime_resume(struct device *dev)
+static int i2s_tdm_runtime_resume(struct device *dev)
{
struct rk_i2s_tdm_dev *i2s_tdm = dev_get_drvdata(dev);
int ret;
@@ -1390,7 +1390,7 @@ static void rockchip_i2s_tdm_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
}
-static int __maybe_unused rockchip_i2s_tdm_suspend(struct device *dev)
+static int rockchip_i2s_tdm_suspend(struct device *dev)
{
struct rk_i2s_tdm_dev *i2s_tdm = dev_get_drvdata(dev);
@@ -1399,7 +1399,7 @@ static int __maybe_unused rockchip_i2s_tdm_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused rockchip_i2s_tdm_resume(struct device *dev)
+static int rockchip_i2s_tdm_resume(struct device *dev)
{
struct rk_i2s_tdm_dev *i2s_tdm = dev_get_drvdata(dev);
int ret;
@@ -1414,10 +1414,8 @@ static int __maybe_unused rockchip_i2s_tdm_resume(struct device *dev)
}
static const struct dev_pm_ops rockchip_i2s_tdm_pm_ops = {
- SET_RUNTIME_PM_OPS(i2s_tdm_runtime_suspend, i2s_tdm_runtime_resume,
- NULL)
- SET_SYSTEM_SLEEP_PM_OPS(rockchip_i2s_tdm_suspend,
- rockchip_i2s_tdm_resume)
+ RUNTIME_PM_OPS(i2s_tdm_runtime_suspend, i2s_tdm_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(rockchip_i2s_tdm_suspend, rockchip_i2s_tdm_resume)
};
static struct platform_driver rockchip_i2s_tdm_driver = {
@@ -1426,7 +1424,7 @@ static struct platform_driver rockchip_i2s_tdm_driver = {
.driver = {
.name = DRV_NAME,
.of_match_table = rockchip_i2s_tdm_match,
- .pm = &rockchip_i2s_tdm_pm_ops,
+ .pm = pm_ptr(&rockchip_i2s_tdm_pm_ops),
},
};
module_platform_driver(rockchip_i2s_tdm_driver);
diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c
index cae91108f7a8..c1ee470ec607 100644
--- a/sound/soc/rockchip/rockchip_pdm.c
+++ b/sound/soc/rockchip/rockchip_pdm.c
@@ -668,7 +668,6 @@ static void rockchip_pdm_remove(struct platform_device *pdev)
clk_disable_unprepare(pdm->hclk);
}
-#ifdef CONFIG_PM_SLEEP
static int rockchip_pdm_suspend(struct device *dev)
{
struct rk_pdm_dev *pdm = dev_get_drvdata(dev);
@@ -693,12 +692,11 @@ 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,
- rockchip_pdm_runtime_resume, NULL)
- SET_SYSTEM_SLEEP_PM_OPS(rockchip_pdm_suspend, rockchip_pdm_resume)
+ RUNTIME_PM_OPS(rockchip_pdm_runtime_suspend,
+ rockchip_pdm_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(rockchip_pdm_suspend, rockchip_pdm_resume)
};
static struct platform_driver rockchip_pdm_driver = {
@@ -707,7 +705,7 @@ static struct platform_driver rockchip_pdm_driver = {
.driver = {
.name = "rockchip-pdm",
.of_match_table = of_match_ptr(rockchip_pdm_match),
- .pm = &rockchip_pdm_pm_ops,
+ .pm = pm_ptr(&rockchip_pdm_pm_ops),
},
};
diff --git a/sound/soc/rockchip/rockchip_spdif.c b/sound/soc/rockchip/rockchip_spdif.c
index d87c0e4f6f91..d365168934dc 100644
--- a/sound/soc/rockchip/rockchip_spdif.c
+++ b/sound/soc/rockchip/rockchip_spdif.c
@@ -63,7 +63,7 @@ static const struct of_device_id rk_spdif_match[] __maybe_unused = {
};
MODULE_DEVICE_TABLE(of, rk_spdif_match);
-static int __maybe_unused rk_spdif_runtime_suspend(struct device *dev)
+static int rk_spdif_runtime_suspend(struct device *dev)
{
struct rk_spdif_dev *spdif = dev_get_drvdata(dev);
@@ -74,7 +74,7 @@ static int __maybe_unused rk_spdif_runtime_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused rk_spdif_runtime_resume(struct device *dev)
+static int rk_spdif_runtime_resume(struct device *dev)
{
struct rk_spdif_dev *spdif = dev_get_drvdata(dev);
int ret;
@@ -374,8 +374,7 @@ static void rk_spdif_remove(struct platform_device *pdev)
}
static const struct dev_pm_ops rk_spdif_pm_ops = {
- SET_RUNTIME_PM_OPS(rk_spdif_runtime_suspend, rk_spdif_runtime_resume,
- NULL)
+ RUNTIME_PM_OPS(rk_spdif_runtime_suspend, rk_spdif_runtime_resume, NULL)
};
static struct platform_driver rk_spdif_driver = {
@@ -384,7 +383,7 @@ static struct platform_driver rk_spdif_driver = {
.driver = {
.name = "rockchip-spdif",
.of_match_table = of_match_ptr(rk_spdif_match),
- .pm = &rk_spdif_pm_ops,
+ .pm = pm_ptr(&rk_spdif_pm_ops),
},
};
module_platform_driver(rk_spdif_driver);
--
2.43.0
next prev parent reply other threads:[~2025-03-13 17:45 UTC|newest]
Thread overview: 97+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-13 17:40 [PATCH 00/89] ASoC: Convert to modern PM macros Takashi Iwai
2025-03-13 17:40 ` [PATCH 01/89] ASoC: au1x: Convert to DEFINE_SIPMLE_DEV_PM_OPS() Takashi Iwai
2025-03-13 17:40 ` [PATCH 02/89] ASoC: ak4375: Convert to RUNTIME_PM_OPS() & co Takashi Iwai
2025-03-13 17:40 ` [PATCH 03/89] ASoC: ak4458: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 04/89] ASoC: ak5558: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 05/89] ASoC: cs35l32: Convert to RUNTIME_PM_OPS() Takashi Iwai
2025-03-13 17:40 ` [PATCH 06/89] ASoC: cs35l33: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 07/89] ASoC: cs35l34: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 08/89] ASoC: cs35l56: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 09/89] ASoC: cs4234: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 10/89] ASoC: cs42l42: Convert to RUNTIME_PM_OPS() & co Takashi Iwai
2025-03-13 17:40 ` [PATCH 11/89] ASoC: cs42l51: Convert to SYSTEM_SLEEP_PM_OPS() Takashi Iwai
2025-03-13 17:40 ` [PATCH 12/89] ASoC: cs42l83: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 13/89] ASoC: cs42xx8: Convert to EXPORT_GPL_DEV_PM_OPS() Takashi Iwai
2025-03-13 17:40 ` [PATCH 14/89] ASoC: cs43130: Convert to RUNTIME_PM_OPS() Takashi Iwai
2025-03-13 17:40 ` [PATCH 15/89] ASoC: cs4349: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 16/89] ASoC: cs53l30: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 17/89] ASoC: cx2072x: Convert to RUNTIME_PM_OPS() & co Takashi Iwai
2025-03-13 17:40 ` [PATCH 18/89] ASoC: da7213: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 19/89] ASoC: hdac_hdmi: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 20/89] ASoC: lpass: Convert to RUNTIME_PM_OPS() Takashi Iwai
2025-03-13 17:40 ` [PATCH 21/89] ASoC: max98090: Convert to RUNTIME_PM_OPS() & co Takashi Iwai
2025-03-13 17:40 ` [PATCH 22/89] ASoC: max98373: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 23/89] ASoC: max98390: Convert to SYSTEM_SLEEP_PM_OPS() Takashi Iwai
2025-03-13 17:40 ` [PATCH 24/89] ASoC: max98396: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 25/89] ASoC: max98520: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 26/89] ASoC: max9860: Convert to RUNTIME_PM_OPS() Takashi Iwai
2025-03-13 17:40 ` [PATCH 27/89] ASoC: max98927: Convert to SYSTEM_SLEEP_PM_OPS() Takashi Iwai
2025-03-13 17:40 ` [PATCH 28/89] ASoC: mt6660: Convert to RUNTIME_PM_OPS() Takashi Iwai
2025-03-13 17:40 ` [PATCH 29/89] ASoC: pcm512x: Convert to EXPORT_GPL_DEV_PM_OPS() Takashi Iwai
2025-03-13 17:40 ` [PATCH 30/89] ASoC: rt1017-sdca-sdw: Convert to RUNTIME_PM_OPS() & co Takashi Iwai
2025-03-13 17:40 ` [PATCH 31/89] ASoC: rt1308-sdw: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 32/89] ASoC: rt1316-sdw: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 33/89] ASoC: rt1318-sdw: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 34/89] ASoC: rt1320-sdw: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 35/89] ASoC: rt5514: Convert to SYSTEM_SLEEP_PM_OPS() Takashi Iwai
2025-03-13 17:40 ` [PATCH 36/89] ASoC: rt5645: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 37/89] ASoC: rt5682-sdw: Convert to RUNTIME_PM_OPS() & co Takashi Iwai
2025-03-13 17:40 ` [PATCH 38/89] ASoC: rt700-sdw: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 39/89] ASoC: rt711: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 40/89] ASoC: rt712: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 41/89] ASoC: rt715: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 42/89] ASoC: rt721: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 43/89] ASoC: rt722: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 44/89] ASoC: rt9120: Convert to RUNTIME_PM_OPS() Takashi Iwai
2025-03-13 17:40 ` [PATCH 45/89] ASoC: rtq9128: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 46/89] ASoC: tas2552: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 47/89] ASoC: ts3a227e: Convert to SYSTEM_SLEEP_PM_OPS() Takashi Iwai
2025-03-13 17:40 ` [PATCH 48/89] ASoC: wcd937x: Convert to RUNTIME_PM_OPS() Takashi Iwai
2025-03-13 17:40 ` [PATCH 49/89] ASoC: wcd938x: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 50/89] ASoC: wcd939x: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 51/89] ASoC: wm2200: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 52/89] ASoC: wm5100: " Takashi Iwai
2025-03-13 17:40 ` [PATCH 53/89] ASoC: wm8804: Convert to EXPORT_GPL_DEV_PM_OPS() Takashi Iwai
2025-03-13 17:40 ` [PATCH 54/89] ASoC: wm8962: Convert to RUNTIME_PM_OPS() & co Takashi Iwai
2025-03-13 17:41 ` [PATCH 55/89] ASoC: wm8994: Convert to SYSTEM_SLEEP_PM_OPS() Takashi Iwai
2025-03-13 17:41 ` [PATCH 56/89] ASoC: wsa881x: Convert to RUNTIME_PM_OPS() Takashi Iwai
2025-03-13 17:41 ` [PATCH 57/89] ASoC: wsa883x: " Takashi Iwai
2025-03-13 17:41 ` [PATCH 58/89] ASoC: wsa884x: " Takashi Iwai
2025-03-13 17:41 ` [PATCH 59/89] ASoC: dwc: " Takashi Iwai
2025-03-13 17:41 ` [PATCH 60/89] ASoC: fsl: Convert to RUNTIME_PM_OPS() and co Takashi Iwai
2025-03-13 17:41 ` [PATCH 61/89] ASoC: img: " Takashi Iwai
2025-03-13 17:41 ` [PATCH 62/89] ASoC: intel: avs: Convert to RUNTIE_PM_OPS() Takashi Iwai
2025-03-13 17:41 ` [PATCH 63/89] ASoC: intel: catpt: Convert to RUNTIE_PM_OPS() & co Takashi Iwai
2025-03-13 17:41 ` [PATCH 64/89] ASoC: mediatek: mt2701: Convert to RUNTIME_PM_OPS() Takashi Iwai
2025-03-13 17:41 ` [PATCH 65/89] ASoC: mediatek: mt6797: " Takashi Iwai
2025-03-13 17:41 ` [PATCH 66/89] ASoC: mediatek: mt7986: " Takashi Iwai
2025-03-13 17:41 ` [PATCH 67/89] ASoC: mediatek: mt8173: " Takashi Iwai
2025-03-13 17:41 ` [PATCH 68/89] ASoC: mediatek: mt8183: " Takashi Iwai
2025-03-13 17:41 ` [PATCH 69/89] ASoC: mediatek: mt8186: " Takashi Iwai
2025-03-13 17:41 ` [PATCH 70/89] ASoC: mediatek: mt8188: " Takashi Iwai
2025-03-13 17:41 ` [PATCH 71/89] ASoC: mediatek: mt8192: " Takashi Iwai
2025-03-13 17:41 ` [PATCH 72/89] ASoC: mediatek: mt8195: " Takashi Iwai
2025-03-13 17:41 ` [PATCH 73/89] ASoC: mediatek: mt8365: Convert to RUNTIME_PM_OPS() & co Takashi Iwai
2025-03-13 17:41 ` [PATCH 74/89] ASoC: qcom: Convert to SYSTEM_SLEEP_PM_OPS() Takashi Iwai
2025-03-13 17:41 ` [PATCH 75/89] ASoC: rcar: " Takashi Iwai
2025-03-14 1:43 ` Kuninori Morimoto
2025-03-13 17:41 ` Takashi Iwai [this message]
2025-03-13 17:41 ` [PATCH 77/89] ASoC: samsung: Convert to RUNTIME_PM_OPS() & co Takashi Iwai
2025-03-13 17:41 ` [PATCH 78/89] ASoC: SOF: acpi: Convert to EXPORT_NS_DEV_PM_OPS() Takashi Iwai
2025-03-13 17:41 ` [PATCH 79/89] ASoC: SOF: pci: " Takashi Iwai
2025-03-13 17:41 ` [PATCH 80/89] ASoC: SOF: of: " Takashi Iwai
2025-03-13 17:41 ` [PATCH 81/89] ASoC: stm: Convert to SYSTEM_SLEEP_PM_OPS() Takashi Iwai
2025-03-13 17:41 ` [PATCH 82/89] ASoC: sunxi: Convert to RUNTIME_PM_OPS() Takashi Iwai
2025-03-13 17:41 ` [PATCH 83/89] ASoC: tegra186: Convert to RUNTIME_PM_OPS() & co Takashi Iwai
2025-03-13 17:41 ` [PATCH 84/89] ASoC: tegra210: " Takashi Iwai
2025-03-13 17:41 ` [PATCH 85/89] ASoC: tegra20: " Takashi Iwai
2025-03-13 17:41 ` [PATCH 86/89] ASoC: tegra30: " Takashi Iwai
2025-03-13 17:41 ` [PATCH 87/89] ASoC: xtensa: Convert to RUNTIME_PM_OPS() Takashi Iwai
2025-03-13 18:01 ` Max Filippov
2025-03-13 17:41 ` [PATCH 88/89] ASoC: amd: Convert to RUNTIME_PM_OPS() & co Takashi Iwai
2025-03-13 17:41 ` [PATCH 89/89] ASoC: pcm3168a: Convert to EXPORT_GPL_DEV_PM_OPS() Takashi Iwai
2025-03-14 7:02 ` [PATCH 00/89] ASoC: Convert to modern PM macros Geraldo Nascimento
2025-03-14 8:36 ` Takashi Iwai
2025-03-14 9:39 ` Geraldo Nascimento
2025-03-14 15:36 ` Charles Keepax
2025-03-17 21:54 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250313174139.29942-77-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=broonie@kernel.org \
--cc=linux-sound@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox