Skip to contentSkip to conversation

fbdev: imxfb: switch to DEFINE_SIMPLE_DEV_PM_OPS

PATCH In review Martin Kaiser 2 participants 2 messages Jun 28, 2023 – Jun 30, 2023

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

PATCH 1/1 fbdev: imxfb: switch to DEFINE_SIMPLE_DEV_PM_OPS

SIMPLE_DEV_PM_OPS is deprecated, replace it with DEFINE_SIMPLE_DEV_PM_OPS and use pm_sleep_ptr for setting the driver's pm routines. We can now remove the __maybe_unused qualifier in the suspend and resume functions.

---
 drivers/video/fbdev/imxfb.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/video/fbdev/imxfb.c +4 -4
index 5fbcb78a9cae..04f3bf30a529 100644
@@ -1066,7 +1066,7 @@ static void imxfb_remove(struct platform_device *pdev)
 	framebuffer_release(info);
 }
 
-static int __maybe_unused imxfb_suspend(struct device *dev)
+static int imxfb_suspend(struct device *dev)
 {
 	struct fb_info *info = dev_get_drvdata(dev);
 	struct imxfb_info *fbi = info->par;
@@ -1076,7 +1076,7 @@ static int __maybe_unused imxfb_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused imxfb_resume(struct device *dev)
+static int imxfb_resume(struct device *dev)
 {
 	struct fb_info *info = dev_get_drvdata(dev);
 	struct imxfb_info *fbi = info->par;
@@ -1086,13 +1086,13 @@ static int __maybe_unused imxfb_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(imxfb_pm_ops, imxfb_suspend, imxfb_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(imxfb_pm_ops, imxfb_suspend, imxfb_resume);
 
 static struct platform_driver imxfb_driver = {
 	.driver		= {
 		.name	= DRIVER_NAME,
 		.of_match_table = imxfb_of_dev_id,
-		.pm	= &imxfb_pm_ops,
+		.pm	= pm_sleep_ptr(&imxfb_pm_ops),
 	},
 	.probe		= imxfb_probe,
 	.remove_new	= imxfb_remove,
Signature · 7 lines
2.30.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer
#1 lore raw
Quoted 5 lines · Martin Kaiser

SIMPLE_DEV_PM_OPS is deprecated, replace it with DEFINE_SIMPLE_DEV_PM_OPS and use pm_sleep_ptr for setting the driver's pm routines. We can now remove the __maybe_unused qualifier in the suspend and resume functions.

both patches applied.

Thanks!
Helge

Quoted 42 lines
---
  drivers/video/fbdev/imxfb.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
drivers/video/fbdev/imxfb.c +4 -4
index 5fbcb78a9cae..04f3bf30a529 100644
@@ -1066,7 +1066,7 @@ static void imxfb_remove(struct platform_device *pdev)
  	framebuffer_release(info);
  }
 
-static int __maybe_unused imxfb_suspend(struct device *dev)
+static int imxfb_suspend(struct device *dev)
  {
  	struct fb_info *info = dev_get_drvdata(dev);
  	struct imxfb_info *fbi = info->par;
@@ -1076,7 +1076,7 @@ static int __maybe_unused imxfb_suspend(struct device *dev)
  	return 0;
  }
 
-static int __maybe_unused imxfb_resume(struct device *dev)
+static int imxfb_resume(struct device *dev)
  {
  	struct fb_info *info = dev_get_drvdata(dev);
  	struct imxfb_info *fbi = info->par;
@@ -1086,13 +1086,13 @@ static int __maybe_unused imxfb_resume(struct device *dev)
  	return 0;
  }
 
-static SIMPLE_DEV_PM_OPS(imxfb_pm_ops, imxfb_suspend, imxfb_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(imxfb_pm_ops, imxfb_suspend, imxfb_resume);
 
  static struct platform_driver imxfb_driver = {
  	.driver		= {
  		.name	= DRIVER_NAME,
  		.of_match_table = imxfb_of_dev_id,
-		.pm	= &imxfb_pm_ops,
+		.pm	= pm_sleep_ptr(&imxfb_pm_ops),
  	},
  	.probe		= imxfb_probe,
  	.remove_new	= imxfb_remove,