From: Fabio Estevam <festevam@gmail.com>
To: broonie@kernel.org
Cc: shengjiu.wang@gmail.com, alsa-devel@alsa-project.org,
Fabio Estevam <festevam@denx.de>
Subject: [PATCH 1/3] ASoC: fsl: fsl_aud2htx: Switch to RUNTIME_PM_OPS()
Date: Tue, 7 May 2024 14:37:33 -0300 [thread overview]
Message-ID: <20240507173735.3456334-1-festevam@gmail.com> (raw)
From: Fabio Estevam <festevam@denx.de>
Replace SET_RUNTIME_PM_OPS() with its modern alternative RUNTIME_PM_OPS().
The combined usage of pm_ptr() and RUNTIME_PM_OPS() allows the
compiler to evaluate if the runtime suspend/resume() functions are used
at build time or are simply dead code.
This allows removing the __maybe_unused notation from the runtime
suspend/resume() functions.
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
sound/soc/fsl/fsl_aud2htx.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/sound/soc/fsl/fsl_aud2htx.c b/sound/soc/fsl/fsl_aud2htx.c
index ee2f6ad1f800..a6cbaa6364c7 100644
--- a/sound/soc/fsl/fsl_aud2htx.c
+++ b/sound/soc/fsl/fsl_aud2htx.c
@@ -261,7 +261,7 @@ static void fsl_aud2htx_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
}
-static int __maybe_unused fsl_aud2htx_runtime_suspend(struct device *dev)
+static int fsl_aud2htx_runtime_suspend(struct device *dev)
{
struct fsl_aud2htx *aud2htx = dev_get_drvdata(dev);
@@ -271,7 +271,7 @@ static int __maybe_unused fsl_aud2htx_runtime_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused fsl_aud2htx_runtime_resume(struct device *dev)
+static int fsl_aud2htx_runtime_resume(struct device *dev)
{
struct fsl_aud2htx *aud2htx = dev_get_drvdata(dev);
int ret;
@@ -288,9 +288,8 @@ static int __maybe_unused fsl_aud2htx_runtime_resume(struct device *dev)
}
static const struct dev_pm_ops fsl_aud2htx_pm_ops = {
- SET_RUNTIME_PM_OPS(fsl_aud2htx_runtime_suspend,
- fsl_aud2htx_runtime_resume,
- NULL)
+ RUNTIME_PM_OPS(fsl_aud2htx_runtime_suspend, fsl_aud2htx_runtime_resume,
+ NULL)
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
pm_runtime_force_resume)
};
@@ -300,7 +299,7 @@ static struct platform_driver fsl_aud2htx_driver = {
.remove_new = fsl_aud2htx_remove,
.driver = {
.name = "fsl-aud2htx",
- .pm = &fsl_aud2htx_pm_ops,
+ .pm = pm_ptr(&fsl_aud2htx_pm_ops),
.of_match_table = fsl_aud2htx_dt_ids,
},
};
--
2.34.1
next reply other threads:[~2024-05-07 17:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-07 17:37 Fabio Estevam [this message]
2024-05-07 17:37 ` [PATCH 2/3] ASoC: fsl: fsl_easrc: Switch to RUNTIME_PM_OPS() Fabio Estevam
2024-05-17 3:07 ` Shengjiu Wang
2024-05-07 17:37 ` [PATCH 3/3] ASoC: fsl: fsl_xcvr: " Fabio Estevam
2024-05-17 3:07 ` Shengjiu Wang
2024-05-17 3:07 ` [PATCH 1/3] ASoC: fsl: fsl_aud2htx: " Shengjiu Wang
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=20240507173735.3456334-1-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=festevam@denx.de \
--cc=shengjiu.wang@gmail.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).