diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index e789c8286c2e..7fe1e681880c 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -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);