* [PATCH] drm/panel: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
@ 2026-08-20 9:01 Triet Hoang
0 siblings, 0 replies; only message in thread
From: Triet Hoang @ 2026-08-20 9:01 UTC (permalink / raw)
To: neil.armstrong
Cc: jesszhan0024, 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 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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-20 9:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20 9:01 [PATCH] drm/panel: 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