Use the drm_mode_config_pm_ops structure exported by
drm_modeset_helper.c, which provides the exact same PM callbacks.

Signed-off-by: Paul Cercueil <p...@crapouillou.net>
---
Cc: Philipp Zabel <p.za...@pengutronix.de>
Cc: Shawn Guo <shawn...@kernel.org>
Cc: Sascha Hauer <s.ha...@pengutronix.de>
Cc: Pengutronix Kernel Team <ker...@pengutronix.de>
Cc: Fabio Estevam <feste...@gmail.com>
Cc: NXP Linux Team <linux-...@nxp.com>
Cc: linux-arm-ker...@lists.infradead.org
---
 drivers/gpu/drm/imx/imx-drm-core.c | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/imx/imx-drm-core.c 
b/drivers/gpu/drm/imx/imx-drm-core.c
index 8dd8b0f912af..4cbd15c2c8ea 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -10,6 +10,7 @@
 #include <linux/dma-buf.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
+#include <linux/pm.h>
 
 #include <video/imx-ipu-v3.h>
 
@@ -298,24 +299,6 @@ static int imx_drm_platform_remove(struct platform_device 
*pdev)
        return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
-static int imx_drm_suspend(struct device *dev)
-{
-       struct drm_device *drm_dev = dev_get_drvdata(dev);
-
-       return drm_mode_config_helper_suspend(drm_dev);
-}
-
-static int imx_drm_resume(struct device *dev)
-{
-       struct drm_device *drm_dev = dev_get_drvdata(dev);
-
-       return drm_mode_config_helper_resume(drm_dev);
-}
-#endif
-
-static SIMPLE_DEV_PM_OPS(imx_drm_pm_ops, imx_drm_suspend, imx_drm_resume);
-
 static const struct of_device_id imx_drm_dt_ids[] = {
        { .compatible = "fsl,imx-display-subsystem", },
        { /* sentinel */ },
@@ -327,7 +310,7 @@ static struct platform_driver imx_drm_pdrv = {
        .remove         = imx_drm_platform_remove,
        .driver         = {
                .name   = "imx-drm",
-               .pm     = &imx_drm_pm_ops,
+               .pm     = pm_sleep_ptr(&drm_mode_config_pm_ops),
                .of_match_table = imx_drm_dt_ids,
        },
 };
-- 
2.35.1

Reply via email to