Skip to contentSkip to conversation

drm/kmb: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

PATCH New Triet Hoang 1 participant 1 message Aug 20

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/kmb: 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.

---
 drivers/gpu/drm/kmb/kmb_drv.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/kmb/kmb_drv.c +4 -4
index 7c2eb1152fc2..1a5ff6067eb4 100644
@@ -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,
 	},
 };
Signature · 1 line
2.53.0