drm: bridge: dw-hdmi: Check whether hdmi is initialized when hdmi suspend or resume

Hdmi suspend or resume may be called before hdmi initialization. We must
verify that hdmi is initialized first.

Change-Id: I2a680209e64b9c1aebc2d9ee19d543927137afd0
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
This commit is contained in:
Algea Cao
2019-01-03 10:50:33 +08:00
committed by Tao Huang
parent 90988f0da1
commit 725bdaa024

View File

@@ -3837,6 +3837,11 @@ void dw_hdmi_suspend(struct device *dev)
{
struct dw_hdmi *hdmi = dev_get_drvdata(dev);
if (!hdmi) {
dev_warn(dev, "Hdmi has not been initialized\n");
return;
}
mutex_lock(&hdmi->mutex);
/*
@@ -3864,6 +3869,11 @@ void dw_hdmi_resume(struct device *dev)
{
struct dw_hdmi *hdmi = dev_get_drvdata(dev);
if (!hdmi) {
dev_warn(dev, "Hdmi has not been initialized\n");
return;
}
pinctrl_pm_select_default_state(dev);
mutex_lock(&hdmi->mutex);
dw_hdmi_reg_initial(hdmi);