提交 852fe0fb 编写于 作者: M Miaoqian Lin 提交者: Zheng Zengkai

drm/bridge: Fix error handling in analogix_dp_probe

stable inclusion
from stable-v5.10.121
commit f35c3f2374082b56353d2cfafccf933ce241349a
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6CQ

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f35c3f2374082b56353d2cfafccf933ce241349a

--------------------------------

[ Upstream commit 9f15930b ]

In the error handling path, the clk_prepare_enable() function
call should be balanced by a corresponding 'clk_disable_unprepare()'
call, as already done in the remove function.

Fixes: 3424e3a4 ("drm: bridge: analogix/dp: split exynos dp driver to bridge directory")
Signed-off-by: NMiaoqian Lin <linmq006@gmail.com>
Reviewed-by: NRobert Foss <robert.foss@linaro.org>
Signed-off-by: NRobert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220420011644.25730-1-linmq006@gmail.comSigned-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 1003a4fe
......@@ -1705,8 +1705,10 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
dp->reg_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(dp->reg_base))
return ERR_CAST(dp->reg_base);
if (IS_ERR(dp->reg_base)) {
ret = PTR_ERR(dp->reg_base);
goto err_disable_clk;
}
dp->force_hpd = of_property_read_bool(dev->of_node, "force-hpd");
......@@ -1718,7 +1720,8 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)
if (IS_ERR(dp->hpd_gpiod)) {
dev_err(dev, "error getting HDP GPIO: %ld\n",
PTR_ERR(dp->hpd_gpiod));
return ERR_CAST(dp->hpd_gpiod);
ret = PTR_ERR(dp->hpd_gpiod);
goto err_disable_clk;
}
if (dp->hpd_gpiod) {
......@@ -1738,7 +1741,8 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)
if (dp->irq == -ENXIO) {
dev_err(&pdev->dev, "failed to get irq\n");
return ERR_PTR(-ENODEV);
ret = -ENODEV;
goto err_disable_clk;
}
ret = devm_request_threaded_irq(&pdev->dev, dp->irq,
......@@ -1747,11 +1751,15 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)
irq_flags, "analogix-dp", dp);
if (ret) {
dev_err(&pdev->dev, "failed to request irq\n");
return ERR_PTR(ret);
goto err_disable_clk;
}
disable_irq(dp->irq);
return dp;
err_disable_clk:
clk_disable_unprepare(dp->clock);
return ERR_PTR(ret);
}
EXPORT_SYMBOL_GPL(analogix_dp_probe);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册