All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/kmb: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
@ 2026-08-20  8:53 Triet Hoang
  0 siblings, 0 replies; only message in thread
From: Triet Hoang @ 2026-08-20  8:53 UTC (permalink / raw)
  To: anitha.chrisanthus; +Cc: airlied, simona, dri-devel, linux-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/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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-20  8:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20  8:53 [PATCH] drm/kmb: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.