From: jeffy.chen@rock-chips.com (Jeffy Chen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 9/9] drm/rockchip: dw_hdmi: Fix error handling path
Date: Wed, 18 Oct 2017 20:09:44 +0800 [thread overview]
Message-ID: <20171018120944.7819-10-jeffy.chen@rock-chips.com> (raw)
In-Reply-To: <20171018120944.7819-1-jeffy.chen@rock-chips.com>
Add missing clk_disable_unprepare() in bind()'s error handling path and
unbind().
Also inline clk_prepare_enable() with bind().
Fixes: 12b9f204e804 ("drm: bridge/dw_hdmi: add rockchip rk3288 support")
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
Changes in v5:
Add disable to unbind(), and inline clk_prepare_enable() with bind().
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
index 791ab938f998..e936dfe6c03d 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
@@ -193,13 +193,6 @@ static int rockchip_hdmi_parse_dt(struct rockchip_hdmi *hdmi)
return PTR_ERR(hdmi->grf_clk);
}
- ret = clk_prepare_enable(hdmi->vpll_clk);
- if (ret) {
- DRM_DEV_ERROR(hdmi->dev,
- "Failed to enable HDMI vpll: %d\n", ret);
- return ret;
- }
-
return 0;
}
@@ -374,6 +367,13 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
return ret;
}
+ ret = clk_prepare_enable(hdmi->vpll_clk);
+ if (ret) {
+ DRM_DEV_ERROR(hdmi->dev,
+ "Failed to enable HDMI vpll: %d\n", ret);
+ return ret;
+ }
+
drm_encoder_helper_add(encoder, &dw_hdmi_rockchip_encoder_helper_funcs);
drm_encoder_init(drm, encoder, &dw_hdmi_rockchip_encoder_funcs,
DRM_MODE_ENCODER_TMDS, NULL);
@@ -381,6 +381,7 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
hdmi->hdmi = dw_hdmi_bind(pdev, encoder, plat_data);
if (IS_ERR(hdmi->hdmi)) {
encoder->funcs->destroy(encoder);
+ clk_disable_unprepare(hdmi->vpll_clk);
return PTR_ERR(hdmi->hdmi);
}
@@ -396,6 +397,7 @@ static void dw_hdmi_rockchip_unbind(struct device *dev, struct device *master,
dw_hdmi_unbind(hdmi->hdmi);
hdmi->encoder.funcs->destroy(&hdmi->encoder);
+ clk_disable_unprepare(hdmi->vpll_clk);
}
static const struct component_ops dw_hdmi_rockchip_ops = {
--
2.11.0
prev parent reply other threads:[~2017-10-18 12:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-18 12:09 [PATCH v5 0/9] rockchip: kevin: Enable edp display Jeffy Chen
2017-10-18 12:09 ` [PATCH v5 1/9] arm64: dts: rockchip: Enable edp disaplay on kevin Jeffy Chen
2017-10-18 12:09 ` [PATCH v5 2/9] drm/rockchip: analogix_dp: Remove unnecessary init code Jeffy Chen
2017-10-18 12:09 ` [PATCH v5 3/9] drm/bridge: analogix: Do not use device's drvdata Jeffy Chen
2017-10-18 12:09 ` [PATCH v5 4/9] drm/bridge: analogix_dp: Fix connector & encoder cleanup Jeffy Chen
2017-10-18 13:22 ` Andrzej Hajda
2017-10-18 12:09 ` [PATCH v5 5/9] drm/rockchip: dw-mipi-dsi: Fix error handling path Jeffy Chen
2017-10-18 12:09 ` [PATCH v5 6/9] drm/rockchip: inno_hdmi: " Jeffy Chen
2017-10-18 12:09 ` [PATCH v5 8/9] drm/bridge/synopsys: dw-hdmi: Do not use device's drvdata Jeffy Chen
2017-10-18 16:03 ` Neil Armstrong
2017-10-18 12:09 ` Jeffy Chen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171018120944.7819-10-jeffy.chen@rock-chips.com \
--to=jeffy.chen@rock-chips.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).