linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Abhinav Kumar <abhinavk@codeaurora.org>
To: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: thierry.reding@gmail.com, linux-arm-msm@vger.kernel.org,
	dri-devel@lists.freedesktop.org, seanpaul@chromium.org,
	hoegsberg@google.com, linux-arm-msm-owner@vger.kernel.org,
	chandanu@codeaurora.org
Subject: Re: [PATCH v7 1/2] drm/panel: Add support for Truly NT35597 panel driver
Date: Thu, 20 Sep 2018 10:45:45 -0700	[thread overview]
Message-ID: <3896c493074cd4f028cac7ffac9cf341@codeaurora.org> (raw)
In-Reply-To: <20180920165433.GJ1367@tuxbook-pro>

Hi Bjorn

Thanks for the comment.

Yes, I will move of_node_put(dsi1) to right after 
of_find_mipi_dsi_host_by_node and remove it from err_dsi_device.

Thanks

Abhinav
On 2018-09-20 09:54, Bjorn Andersson wrote:
> 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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2018-09-20 17:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20  2:55 [PATCH v7 1/2] drm/panel: Add support for Truly NT35597 panel driver Abhinav Kumar
2018-09-20  2:55 ` [PATCH v7 2/2] dt-bindings: Add Truly NT35597 panel driver bindings Abhinav Kumar
2018-09-21 15:19   ` Linus Walleij
2018-09-20 15:52 ` [PATCH v7 1/2] drm/panel: Add support for Truly NT35597 panel driver Sean Paul
2018-09-20 17:18   ` Abhinav Kumar
2018-09-20 16:54 ` Bjorn Andersson
2018-09-20 17:45   ` Abhinav Kumar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3896c493074cd4f028cac7ffac9cf341@codeaurora.org \
    --to=abhinavk@codeaurora.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=chandanu@codeaurora.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hoegsberg@google.com \
    --cc=linux-arm-msm-owner@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=seanpaul@chromium.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).