mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
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:
@@ -3900,6 +3900,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);
|
||||
|
||||
/*
|
||||
@@ -3927,6 +3932,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);
|
||||
|
||||
Reference in New Issue
Block a user