The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] drm/arm/hdlcd: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
@ 2026-08-20  8:49 Triet Hoang
  0 siblings, 0 replies; only message in thread
From: Triet Hoang @ 2026-08-20  8:49 UTC (permalink / raw)
  To: liviu.dudau
  Cc: maarten.lankhorst, mripard, tzimmermann, 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 the 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/arm/hdlcd_drv.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index 81d45f2dd6a7..f60211de8e59 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -385,14 +385,14 @@ static const struct of_device_id  hdlcd_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, hdlcd_of_match);
 
-static int __maybe_unused hdlcd_pm_suspend(struct device *dev)
+static int hdlcd_pm_suspend(struct device *dev)
 {
 	struct drm_device *drm = dev_get_drvdata(dev);
 
 	return drm_mode_config_helper_suspend(drm);
 }
 
-static int __maybe_unused hdlcd_pm_resume(struct device *dev)
+static int hdlcd_pm_resume(struct device *dev)
 {
 	struct drm_device *drm = dev_get_drvdata(dev);
 
@@ -401,7 +401,7 @@ static int __maybe_unused hdlcd_pm_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(hdlcd_pm_ops, hdlcd_pm_suspend, hdlcd_pm_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(hdlcd_pm_ops, hdlcd_pm_suspend, hdlcd_pm_resume);
 
 static struct platform_driver hdlcd_platform_driver = {
 	.probe		= hdlcd_probe,
@@ -409,7 +409,7 @@ static struct platform_driver hdlcd_platform_driver = {
 	.shutdown	= hdlcd_shutdown,
 	.driver	= {
 		.name = "hdlcd",
-		.pm = &hdlcd_pm_ops,
+		.pm = pm_sleep_ptr(&hdlcd_pm_ops),
 		.of_match_table	= hdlcd_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:49 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:49 [PATCH] drm/arm/hdlcd: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox