From: Triet Hoang <triet.hoang.dev@gmail.com>
To: anitha.chrisanthus@intel.com
Cc: airlied@gmail.com, simona@ffwll.ch,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Triet Hoang <triet.hoang.dev@gmail.com>
Subject: [PATCH] drm/kmb: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Date: Thu, 20 Aug 2026 15:53:01 +0700 [thread overview]
Message-ID: <20260820085301.2101138-1-triet.hoang.dev@gmail.com> (raw)
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/kmb/kmb_drv.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/kmb/kmb_drv.c b/drivers/gpu/drm/kmb/kmb_drv.c
index 7c2eb1152fc2..1a5ff6067eb4 100644
--- a/drivers/gpu/drm/kmb/kmb_drv.c
+++ b/drivers/gpu/drm/kmb/kmb_drv.c
@@ -588,7 +588,7 @@ static const struct of_device_id kmb_of_match[] = {
MODULE_DEVICE_TABLE(of, kmb_of_match);
-static int __maybe_unused kmb_pm_suspend(struct device *dev)
+static int kmb_pm_suspend(struct device *dev)
{
struct drm_device *drm = dev_get_drvdata(dev);
struct kmb_drm_private *kmb = to_kmb(drm);
@@ -604,7 +604,7 @@ static int __maybe_unused kmb_pm_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused kmb_pm_resume(struct device *dev)
+static int kmb_pm_resume(struct device *dev)
{
struct drm_device *drm = dev_get_drvdata(dev);
struct kmb_drm_private *kmb = drm ? to_kmb(drm) : NULL;
@@ -618,14 +618,14 @@ static int __maybe_unused kmb_pm_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(kmb_pm_ops, kmb_pm_suspend, kmb_pm_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(kmb_pm_ops, kmb_pm_suspend, kmb_pm_resume);
static struct platform_driver kmb_platform_driver = {
.probe = kmb_probe,
.remove = kmb_remove,
.driver = {
.name = "kmb-drm",
- .pm = &kmb_pm_ops,
+ .pm = pm_sleep_ptr(&kmb_pm_ops),
.of_match_table = kmb_of_match,
},
};
--
2.53.0
reply other threads:[~2026-08-20 8:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260820085301.2101138-1-triet.hoang.dev@gmail.com \
--to=triet.hoang.dev@gmail.com \
--cc=airlied@gmail.com \
--cc=anitha.chrisanthus@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=simona@ffwll.ch \
/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