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: Thierry Reding <thierry.red...@gmail.com>
Cc: Jonathan Hunter <jonath...@nvidia.com>
Cc: linux-te...@vger.kernel.org
---
 drivers/gpu/drm/tegra/drm.c | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index 6748ec1e0005..c9b6b3acb8c7 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -1325,25 +1325,6 @@ static int host1x_drm_remove(struct host1x_device *dev)
        return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
-static int host1x_drm_suspend(struct device *dev)
-{
-       struct drm_device *drm = dev_get_drvdata(dev);
-
-       return drm_mode_config_helper_suspend(drm);
-}
-
-static int host1x_drm_resume(struct device *dev)
-{
-       struct drm_device *drm = dev_get_drvdata(dev);
-
-       return drm_mode_config_helper_resume(drm);
-}
-#endif
-
-static SIMPLE_DEV_PM_OPS(host1x_drm_pm_ops, host1x_drm_suspend,
-                        host1x_drm_resume);
-
 static const struct of_device_id host1x_drm_subdevs[] = {
        { .compatible = "nvidia,tegra20-dc", },
        { .compatible = "nvidia,tegra20-hdmi", },
@@ -1388,7 +1369,7 @@ static const struct of_device_id host1x_drm_subdevs[] = {
 static struct host1x_driver host1x_drm_driver = {
        .driver = {
                .name = "drm",
-               .pm = &host1x_drm_pm_ops,
+               .pm = pm_sleep_ptr(&drm_mode_config_pm_ops),
        },
        .probe = host1x_drm_probe,
        .remove = host1x_drm_remove,
-- 
2.35.1

Reply via email to