* [PATCH] drm/mediatek: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
@ 2026-08-20 8:56 Triet Hoang
2026-08-20 9:10 ` Markus Elfring
0 siblings, 1 reply; 2+ messages in thread
From: Triet Hoang @ 2026-08-20 8:56 UTC (permalink / raw)
To: chunkuang.hu
Cc: p.zabel, airlied, simona, matthias.bgg, angelogioacchino.delregno,
dri-devel, linux-mediatek, linux-kernel, linux-arm-kernel,
Triet Hoang
Convert the deprecated SIMPLE_DEV_PM_OPS
to DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr().
This lets us drop the __maybe_unused annotations from its suspend and
resume callbacks, and reduces kernel size in case CONFIG_PM or
CONFIG_PM_SLEEP is disabled.
Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
drivers/gpu/drm/mediatek/mtk_hdmi_v2.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi_v2.c b/drivers/gpu/drm/mediatek/mtk_hdmi_v2.c
index ffe456238a2b..a2acb2d9742e 100644
--- a/drivers/gpu/drm/mediatek/mtk_hdmi_v2.c
+++ b/drivers/gpu/drm/mediatek/mtk_hdmi_v2.c
@@ -1412,7 +1412,7 @@ static const struct hdmi_codec_ops mtk_hdmi_v2_audio_codec_ops = {
.hook_plugged_cb = mtk_hdmi_v2_audio_hook_plugged_cb,
};
-static __maybe_unused int mtk_hdmi_v2_suspend(struct device *dev)
+static int mtk_hdmi_v2_suspend(struct device *dev)
{
struct mtk_hdmi *hdmi = dev_get_drvdata(dev);
@@ -1421,14 +1421,14 @@ static __maybe_unused int mtk_hdmi_v2_suspend(struct device *dev)
return 0;
}
-static __maybe_unused int mtk_hdmi_v2_resume(struct device *dev)
+static int mtk_hdmi_v2_resume(struct device *dev)
{
struct mtk_hdmi *hdmi = dev_get_drvdata(dev);
return mtk_hdmi_v2_enable(hdmi);
}
-static SIMPLE_DEV_PM_OPS(mtk_hdmi_v2_pm_ops, mtk_hdmi_v2_suspend, mtk_hdmi_v2_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(mtk_hdmi_v2_pm_ops, mtk_hdmi_v2_suspend, mtk_hdmi_v2_resume);
static const struct mtk_hdmi_ver_conf mtk_hdmi_conf_v2 = {
.bridge_funcs = &mtk_v2_hdmi_bridge_funcs,
@@ -1511,7 +1511,7 @@ static struct platform_driver mtk_hdmi_v2_driver = {
.driver = {
.name = "mediatek-drm-hdmi-v2",
.of_match_table = mtk_drm_hdmi_v2_of_ids,
- .pm = &mtk_hdmi_v2_pm_ops,
+ .pm = pm_sleep_ptr(&mtk_hdmi_v2_pm_ops),
},
};
module_platform_driver(mtk_hdmi_v2_driver);
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/mediatek: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
2026-08-20 8:56 [PATCH] drm/mediatek: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
@ 2026-08-20 9:10 ` Markus Elfring
0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2026-08-20 9:10 UTC (permalink / raw)
To: Triet Hoang, dri-devel, linux-mediatek, linux-arm-kernel,
Angelo Gioacchino Del Regno, Chun-Kuang Hu, David Airlie,
Matthias Brugger, Philipp Zabel, Simona Vetter
Cc: LKML
…
> This lets us drop the __maybe_unused annotations from its suspend and
…
Thus drop …?
Regards,
Markus
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-20 9:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20 8:56 [PATCH] drm/mediatek: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
2026-08-20 9:10 ` Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox