drm/panel: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Subsystems (3)
PATCH 1/1 drm/panel: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
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 <[email protected]>
--- 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(-)
drivers/gpu/drm/panel/panel-nec-nl8048hl11.c +4 -4
@@ -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, }, };
drivers/gpu/drm/panel/panel-tpo-td043mtea1.c +4 -4
@@ -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, }, };
Signature · 1 line
2.53.0