Commit 2b5d74fa authored by Yannick Fertré's avatar Yannick Fertré Committed by Benjamin Gaignard

drm/stm: drv: fix suspend/resume

Without this fix, the system can not go in "suspend" mode
due to an error in drv_suspend function.

Fixes: 35ab6cfb ("drm/stm: support runtime power management")
Signed-off-by: default avatarYannick Fertré <yannick.fertre@st.com>
Acked-by: default avatarPhilippe Cornu <philippe.cornu@st.com>
Signed-off-by: default avatarBenjamin Gaignard <benjamin.gaignard@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1560755897-5002-1-git-send-email-yannick.fertre@st.com
parent 002c845b
...@@ -136,8 +136,7 @@ static __maybe_unused int drv_suspend(struct device *dev) ...@@ -136,8 +136,7 @@ static __maybe_unused int drv_suspend(struct device *dev)
struct ltdc_device *ldev = ddev->dev_private; struct ltdc_device *ldev = ddev->dev_private;
struct drm_atomic_state *state; struct drm_atomic_state *state;
if (WARN_ON(!ldev->suspend_state)) WARN_ON(ldev->suspend_state);
return -ENOENT;
state = drm_atomic_helper_suspend(ddev); state = drm_atomic_helper_suspend(ddev);
if (IS_ERR(state)) if (IS_ERR(state))
...@@ -155,15 +154,17 @@ static __maybe_unused int drv_resume(struct device *dev) ...@@ -155,15 +154,17 @@ static __maybe_unused int drv_resume(struct device *dev)
struct ltdc_device *ldev = ddev->dev_private; struct ltdc_device *ldev = ddev->dev_private;
int ret; int ret;
if (WARN_ON(!ldev->suspend_state))
return -ENOENT;
pm_runtime_force_resume(dev); pm_runtime_force_resume(dev);
ret = drm_atomic_helper_resume(ddev, ldev->suspend_state); ret = drm_atomic_helper_resume(ddev, ldev->suspend_state);
if (ret) { if (ret)
pm_runtime_force_suspend(dev); pm_runtime_force_suspend(dev);
ldev->suspend_state = NULL;
return ret;
}
return 0; ldev->suspend_state = NULL;
return ret;
} }
static __maybe_unused int drv_runtime_suspend(struct device *dev) static __maybe_unused int drv_runtime_suspend(struct device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment