[PATCH v2 1/5] drm/exynos: dsi: Fix the parse_dt function

Andrzej Hajda a.hajda at samsung.com
Thu Feb 9 06:57:40 UTC 2017


On 09.02.2017 02:26, Hoegeun Kwon wrote:
> The dsi + panel is a parental relationship, so OF grpah is not needed.
> Therefore, the current dsi_parse_dt function will throw an error,
> because there is no linked OF graph for case such as fimd + dsi +
> panel. So this patch parse the Pll, burst and esc clock frequency
> properties in dsi_parse_dt and modified to create a bridge_node only
> if there is an OF graph associated with dsi.
> So I think the ABI breakage is needed.
>
> Signed-off-by: Hoegeun Kwon <hoegeun.kwon at samsung.com>

Nice diffstat, more importantly it fixes bad design of early days of
of_graph.

Reviewed-by: Andrzej Hajda <a.hajda at samsung.com>

One comment below.

> ---
>  drivers/gpu/drm/exynos/exynos_drm_dsi.c | 32 ++++++++------------------------
>  1 file changed, 8 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
> index e07cb1f..214d486 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
> @@ -1652,39 +1652,23 @@ static int exynos_dsi_parse_dt(struct exynos_dsi *dsi)
>  	if (ret < 0)
>  		return ret;
>  
> -	ep = of_graph_get_endpoint_by_regs(node, DSI_PORT_OUT, 0);
> -	if (!ep) {
> -		dev_err(dev, "no output port with endpoint specified\n");
> -		return -EINVAL;
> -	}
> -
> -	ret = exynos_dsi_of_read_u32(ep, "samsung,burst-clock-frequency",
> +	ret = exynos_dsi_of_read_u32(node, "samsung,burst-clock-frequency",
>  				     &dsi->burst_clk_rate);
>  	if (ret < 0)
> -		goto end;
> +		return ret;
>  
> -	ret = exynos_dsi_of_read_u32(ep, "samsung,esc-clock-frequency",
> +	ret = exynos_dsi_of_read_u32(node, "samsung,esc-clock-frequency",
>  				     &dsi->esc_clk_rate);
>  	if (ret < 0)
> -		goto end;
> -
> -	of_node_put(ep);
> +		return ret;
>  
>  	ep = of_graph_get_next_endpoint(node, NULL);
> -	if (!ep) {
> -		ret = -EINVAL;
> -		goto end;
> -	}
> -
> -	dsi->bridge_node = of_graph_get_remote_port_parent(ep);
> -	if (!dsi->bridge_node) {
> -		ret = -EINVAL;
> -		goto end;
> +	if (ep) {
> +		dsi->bridge_node = of_graph_get_remote_port_parent(ep);
> +		of_node_put(ep);

It looks like there is no of_node_put on dsi->bridge_node, but this is
for another patch.

Regards
Andrzej

>  	}
> -end:
> -	of_node_put(ep);
>  
> -	return ret;
> +	return 0;
>  }
>  
>  static int exynos_dsi_bind(struct device *dev, struct device *master,




More information about the dri-devel mailing list