2020-12-12 04:13:08

by Tian Tao

[permalink] [raw]
Subject: [PATCH] drm/hisilicon: Add the CONFIG_PM_SLEEP

add the CONFIG_PM_SLEEP to isolate the function of resume and suspend.

Signed-off-by: Tian Tao <[email protected]>
---
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index 7e91ef1..faa664d 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -65,6 +65,7 @@ static const struct drm_driver hibmc_driver = {
.irq_handler = hibmc_drm_interrupt,
};

+#ifdef CONFIG_PM_SLEEP
static int __maybe_unused hibmc_pm_suspend(struct device *dev)
{
struct drm_device *drm_dev = dev_get_drvdata(dev);
@@ -78,6 +79,7 @@ static int __maybe_unused hibmc_pm_resume(struct device *dev)

return drm_mode_config_helper_resume(drm_dev);
}
+#endif

static const struct dev_pm_ops hibmc_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(hibmc_pm_suspend,
--
2.7.4