Skip to content

Commit c0cfbb1

Browse files
saschahauermmind
authored andcommitted
drm/rockchip: dw_hdmi: Do not leave clock enabled in error case
The driver returns an error when devm_phy_optional_get() fails leaving the previously enabled clock turned on. Change order and enable the clock only after the phy has been acquired. Signed-off-by: Sascha Hauer <[email protected]> Signed-off-by: Heiko Stuebner <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent db40577 commit c0cfbb1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -529,13 +529,6 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
529529
return ret;
530530
}
531531

532-
ret = clk_prepare_enable(hdmi->vpll_clk);
533-
if (ret) {
534-
DRM_DEV_ERROR(hdmi->dev, "Failed to enable HDMI vpll: %d\n",
535-
ret);
536-
return ret;
537-
}
538-
539532
hdmi->phy = devm_phy_optional_get(dev, "hdmi");
540533
if (IS_ERR(hdmi->phy)) {
541534
ret = PTR_ERR(hdmi->phy);
@@ -544,6 +537,13 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
544537
return ret;
545538
}
546539

540+
ret = clk_prepare_enable(hdmi->vpll_clk);
541+
if (ret) {
542+
DRM_DEV_ERROR(hdmi->dev, "Failed to enable HDMI vpll: %d\n",
543+
ret);
544+
return ret;
545+
}
546+
547547
drm_encoder_helper_add(encoder, &dw_hdmi_rockchip_encoder_helper_funcs);
548548
drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS);
549549

0 commit comments

Comments
 (0)