gjdwebserver-overlay/sys-kernel/pinephone-pro-sources/files/0005-drm-rockchip-dw-mipi-dsi-Fix-missing-clk_disable_unp.patch

49 lines
1.5 KiB
Diff
Raw Normal View History

2022-01-15 02:12:55 +01:00
From: Ondrej Jirman <megous@megous.com>
Date: Sun, 17 Oct 2021 18:04:21 +0200
Subject: [PATCH 03/36] drm: rockchip: dw-mipi-dsi: Fix missing
clk_disable_unprepare for pllref_clk
In some error paths, clk_disable_unprepare function was not called.
Signed-off-by: Ondrej Jirman <megous@megous.com>
---
drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
index 53c8b40..095d0f1 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
@@ -960,7 +960,7 @@ static int dw_mipi_dsi_rockchip_bind(struct device *dev,
ret = clk_prepare_enable(dsi->grf_clk);
if (ret) {
DRM_DEV_ERROR(dsi->dev, "Failed to enable grf_clk: %d\n", ret);
- return ret;
+ goto err_pllref_disable;
}
dw_mipi_dsi_rockchip_config(dsi);
@@ -972,16 +972,20 @@ static int dw_mipi_dsi_rockchip_bind(struct device *dev,
ret = rockchip_dsi_drm_create_encoder(dsi, drm_dev);
if (ret) {
DRM_DEV_ERROR(dev, "Failed to create drm encoder\n");
- return ret;
+ goto err_pllref_disable;
}
ret = dw_mipi_dsi_bind(dsi->dmd, &dsi->encoder);
if (ret) {
DRM_DEV_ERROR(dev, "Failed to bind: %d\n", ret);
- return ret;
+ goto err_pllref_disable;
}
return 0;
+
+err_pllref_disable:
+ clk_disable_unprepare(dsi->pllref_clk);
+ return ret;
}
static void dw_mipi_dsi_rockchip_unbind(struct device *dev,