mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
drm/rockchip: fix kernel panic when drm driver probe failed
For some reason drm driver maybe probe failed, so the drm_dev is null. this will lead to kernel panic when enter suspend function. Change-Id: Ic529ba9103d27b0766189285bd6cf8e43b23b912 Signed-off-by: Sandy Huang <hjc@rock-chips.com>
This commit is contained in:
@@ -1669,9 +1669,16 @@ static void rockchip_drm_fb_resume(struct drm_device *drm)
|
||||
|
||||
static int rockchip_drm_sys_suspend(struct device *dev)
|
||||
{
|
||||
struct drm_device *drm = dev_get_drvdata(dev);
|
||||
struct rockchip_drm_private *priv = drm->dev_private;
|
||||
struct drm_device *drm;
|
||||
struct rockchip_drm_private *priv;
|
||||
|
||||
drm = dev_get_drvdata(dev);
|
||||
if (!drm) {
|
||||
DRM_ERROR("%s: Failed to get drm device!\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
priv = drm->dev_private;
|
||||
drm_kms_helper_poll_disable(drm);
|
||||
rockchip_drm_fb_suspend(drm);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user