The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Triet Hoang <triet.hoang.dev@gmail.com>
To: neil.armstrong@linaro.org
Cc: jesszhan0024@gmail.com, maarten.lankhorst@linux.intel.com,
	mripard@kernel.org, tzimmermann@suse.de, 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/panel: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Date: Thu, 20 Aug 2026 16:01:19 +0700	[thread overview]
Message-ID: <20260820090119.2107869-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/panel/panel-nec-nl8048hl11.c | 8 ++++----
 drivers/gpu/drm/panel/panel-tpo-td043mtea1.c | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-nec-nl8048hl11.c b/drivers/gpu/drm/panel/panel-nec-nl8048hl11.c
index d5c7210de4af..11e11abcba4a 100644
--- a/drivers/gpu/drm/panel/panel-nec-nl8048hl11.c
+++ b/drivers/gpu/drm/panel/panel-nec-nl8048hl11.c
@@ -149,7 +149,7 @@ static const struct drm_panel_funcs nl8048_funcs = {
 	.get_modes = nl8048_get_modes,
 };
 
-static int __maybe_unused nl8048_suspend(struct device *dev)
+static int nl8048_suspend(struct device *dev)
 {
 	struct nl8048_panel *lcd = dev_get_drvdata(dev);
 
@@ -159,7 +159,7 @@ static int __maybe_unused nl8048_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused nl8048_resume(struct device *dev)
+static int nl8048_resume(struct device *dev)
 {
 	struct nl8048_panel *lcd = dev_get_drvdata(dev);
 
@@ -171,7 +171,7 @@ static int __maybe_unused nl8048_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(nl8048_pm_ops, nl8048_suspend, nl8048_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(nl8048_pm_ops, nl8048_suspend, nl8048_resume);
 
 static int nl8048_probe(struct spi_device *spi)
 {
@@ -239,7 +239,7 @@ static struct spi_driver nl8048_driver = {
 	.id_table	= nl8048_ids,
 	.driver		= {
 		.name	= "panel-nec-nl8048hl11",
-		.pm	= &nl8048_pm_ops,
+		.pm	= pm_sleep_ptr(&nl8048_pm_ops),
 		.of_match_table = nl8048_of_match,
 	},
 };
diff --git a/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c b/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c
index b18af526b54c..455a4237b1e1 100644
--- a/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c
+++ b/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c
@@ -382,7 +382,7 @@ static const struct drm_panel_funcs td043mtea1_funcs = {
  * Power Management, Probe and Remove
  */
 
-static int __maybe_unused td043mtea1_suspend(struct device *dev)
+static int td043mtea1_suspend(struct device *dev)
 {
 	struct td043mtea1_panel *lcd = dev_get_drvdata(dev);
 
@@ -396,7 +396,7 @@ static int __maybe_unused td043mtea1_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused td043mtea1_resume(struct device *dev)
+static int td043mtea1_resume(struct device *dev)
 {
 	struct td043mtea1_panel *lcd = dev_get_drvdata(dev);
 	int ret;
@@ -413,7 +413,7 @@ static int __maybe_unused td043mtea1_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(td043mtea1_pm_ops, td043mtea1_suspend,
+static DEFINE_SIMPLE_DEV_PM_OPS(td043mtea1_pm_ops, td043mtea1_suspend,
 			 td043mtea1_resume);
 
 static int td043mtea1_probe(struct spi_device *spi)
@@ -492,7 +492,7 @@ static struct spi_driver td043mtea1_driver = {
 	.id_table	= td043mtea1_ids,
 	.driver		= {
 		.name	= "panel-tpo-td043mtea1",
-		.pm	= &td043mtea1_pm_ops,
+		.pm	= pm_sleep_ptr(&td043mtea1_pm_ops),
 		.of_match_table = td043mtea1_of_match,
 	},
 };
-- 
2.53.0


                 reply	other threads:[~2026-08-20  9:01 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=20260820090119.2107869-1-triet.hoang.dev@gmail.com \
    --to=triet.hoang.dev@gmail.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jesszhan0024@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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