Skip to content

Commit 547a734

Browse files
tititiou36daeinki
authored andcommitted
drm/exynos: dsi: Remove bridge node reference in error handling path in probe function
'exynos_dsi_parse_dt()' takes a reference to 'dsi->in_bridge_node'. This must be released in the error handling path. In order to do that, add an error handling path and move the 'exynos_dsi_parse_dt()' call from the beginning to the end of the probe function to ease the error handling path. This function only sets some variables which are used only in the 'transfer' function. The call chain is: .transfer --> exynos_dsi_host_transfer --> exynos_dsi_init --> exynos_dsi_enable_clock (use burst_clk_rate and esc_clk_rate) --> exynos_dsi_set_pll (use pll_clk_rate) While at it, also handle cases where 'component_add()' fails. This patch is similar to commit 70505c2 ("drm/exynos: dsi: Remove bridge node reference in removal") which fixed the issue in the remove function. Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Inki Dae <[email protected]>
1 parent fda0221 commit 547a734

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

drivers/gpu/drm/exynos/exynos_drm_dsi.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,10 +1759,6 @@ static int exynos_dsi_probe(struct platform_device *pdev)
17591759
dsi->dev = dev;
17601760
dsi->driver_data = of_device_get_match_data(dev);
17611761

1762-
ret = exynos_dsi_parse_dt(dsi);
1763-
if (ret)
1764-
return ret;
1765-
17661762
dsi->supplies[0].supply = "vddcore";
17671763
dsi->supplies[1].supply = "vddio";
17681764
ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(dsi->supplies),
@@ -1821,11 +1817,25 @@ static int exynos_dsi_probe(struct platform_device *pdev)
18211817
return ret;
18221818
}
18231819

1820+
ret = exynos_dsi_parse_dt(dsi);
1821+
if (ret)
1822+
return ret;
1823+
18241824
platform_set_drvdata(pdev, &dsi->encoder);
18251825

18261826
pm_runtime_enable(dev);
18271827

1828-
return component_add(dev, &exynos_dsi_component_ops);
1828+
ret = component_add(dev, &exynos_dsi_component_ops);
1829+
if (ret)
1830+
goto err_disable_runtime;
1831+
1832+
return 0;
1833+
1834+
err_disable_runtime:
1835+
pm_runtime_disable(dev);
1836+
of_node_put(dsi->in_bridge_node);
1837+
1838+
return ret;
18291839
}
18301840

18311841
static int exynos_dsi_remove(struct platform_device *pdev)

0 commit comments

Comments
 (0)