Skip to content

Commit

Permalink
drm/exynos: dsi: Remove bridge node reference in error handling path …
Browse files Browse the repository at this point in the history
…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 <christophe.jaillet@wanadoo.fr>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
  • Loading branch information
Christophe JAILLET authored and Inki Dae committed May 18, 2020
1 parent fda0221 commit 547a734
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions drivers/gpu/drm/exynos/exynos_drm_dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1759,10 +1759,6 @@ static int exynos_dsi_probe(struct platform_device *pdev)
dsi->dev = dev;
dsi->driver_data = of_device_get_match_data(dev);

ret = exynos_dsi_parse_dt(dsi);
if (ret)
return ret;

dsi->supplies[0].supply = "vddcore";
dsi->supplies[1].supply = "vddio";
ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(dsi->supplies),
Expand Down Expand Up @@ -1821,11 +1817,25 @@ static int exynos_dsi_probe(struct platform_device *pdev)
return ret;
}

ret = exynos_dsi_parse_dt(dsi);
if (ret)
return ret;

platform_set_drvdata(pdev, &dsi->encoder);

pm_runtime_enable(dev);

return component_add(dev, &exynos_dsi_component_ops);
ret = component_add(dev, &exynos_dsi_component_ops);
if (ret)
goto err_disable_runtime;

return 0;

err_disable_runtime:
pm_runtime_disable(dev);
of_node_put(dsi->in_bridge_node);

return ret;
}

static int exynos_dsi_remove(struct platform_device *pdev)
Expand Down

0 comments on commit 547a734

Please sign in to comment.