Re: [PATCH v7 1/2] drm/panel: Add support for Truly NT35597 panel driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed 19 Sep 19:55 PDT 2018, Abhinav Kumar wrote:
> +static int truly_nt35597_probe(struct mipi_dsi_device *dsi)
> +{
[..]
> +	dsi1 = of_graph_get_remote_node(dsi->dev.of_node, 1, -1);
> +	if (!dsi1) {
> +		DRM_DEV_ERROR(dev,
> +			"failed to get remote node for dsi1_device\n");
> +		ret = -ENODEV;
> +		goto err_get_remote;
> +	}
> +
> +	dsi1_host = of_find_mipi_dsi_host_by_node(dsi1);
> +	if (!dsi1_host) {
> +		DRM_DEV_ERROR(dev, "failed to find dsi host\n");
> +		ret = -EPROBE_DEFER;
> +		goto err_host;
> +	}
> +
> +	of_node_put(dsi1);
> +
> +	/* register the second DSI device */
> +	dsi1_device = mipi_dsi_device_register_full(dsi1_host, &info);
> +	if (IS_ERR(dsi1_device)) {
[..]
> +		goto err_dsi_device;
[..]
> +		if (ret < 0) {
> +			DRM_DEV_ERROR(dev,
> +				"dsi attach failed i = %d\n", i);
> +				goto err_dsi_attach;
> +		}
> +	}
> +
> +	return 0;
> +
> +err_dsi_attach:
> +	drm_panel_remove(&ctx->panel);
> +err_panel_add:
> +	mipi_dsi_device_unregister(dsi1_device);
> +err_dsi_device:
> +err_host:
> +	of_node_put(dsi1);

dsi1 is already put if we came here through err_dsi_device et al.

You don't need to reference dsi1 beyond the call to
of_find_mipi_dsi_host_by_node() to put it before checking the dsi1_host.

> +err_get_remote:
> +	return ret;
> +}

Regards,
Bjorn



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux