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