From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: David Airlie <airlied@linux.ie>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
Philipp Zabel <p.zabel@pengutronix.de>,
Mark Yao <mark.yao@rock-chips.com>,
Heiko Stuebner <heiko@sntech.de>,
dri-devel <dri-devel@lists.freedesktop.org>,
linux-rockchip <linux-rockchip@lists.infradead.org>,
LAKML <linux-arm-kernel@lists.infradead.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH v3 1/4] drm: Introduce generic probe function for component based masters.
Date: Mon, 9 Nov 2015 11:15:15 +0000 [thread overview]
Message-ID: <20151109111515.GW8644@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1445267270-23126-2-git-send-email-Liviu.Dudau@arm.com>
On Mon, Oct 19, 2015 at 04:07:47PM +0100, Liviu Dudau wrote:
> A lot of component based DRM drivers use a variant of the same code
> as the probe function. They bind the crtc ports in the first iteration
> and then scan through the child nodes and bind the encoders attached
> to the remote endpoints. Factor the common code into a separate
> function called drm_of_component_probe() in order to increase code
> reuse.
Sorry, I take back my Acked-by.
> + /*
> + * Bind the crtc's ports first, so that drm_of_find_possible_crtcs()
> + * called from encoder's .bind callbacks works as expected
> + */
> + for (i = 0; ; i++) {
> + port = of_parse_phandle(dev->of_node, "ports", i);
> + if (!port)
> + break;
> +
> + if (!of_device_is_available(port->parent)) {
> + of_node_put(port);
> + continue;
> + }
> +
> + component_match_add(dev, &match, compare_of, port);
> + of_node_put(port);
We shouldn't be putting the ports here - we're still retaining a
reference against the port, even though it's by address. Yes, we have
no way to release this reference, which probably ought to be fixed.
Please replace this of_node_put() here with a comment to that effect.
> + for_each_child_of_node(port, ep) {
> + remote = of_graph_get_remote_port_parent(ep);
> + if (!remote || !of_device_is_available(remote)) {
> + of_node_put(remote);
> + continue;
> + } else if (!of_device_is_available(remote->parent)) {
> + dev_warn(dev, "parent device of %s is not available\n",
> + remote->full_name);
> + of_node_put(remote);
> + continue;
> + }
> +
> + component_match_add(dev, &match, compare_of, remote);
> + of_node_put(remote);
Same here.
--
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
next prev parent reply other threads:[~2015-11-09 11:16 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-19 15:07 [RFC PATCH v3 0/4] drm: Cleanup " Liviu Dudau
2015-10-19 15:07 ` [RFC PATCH v3 1/4] drm: Introduce generic " Liviu Dudau
2015-10-19 15:14 ` Russell King - ARM Linux
2015-10-20 9:45 ` Eric Anholt
2015-11-09 9:39 ` Mark yao
2015-11-09 10:53 ` Liviu Dudau
2015-11-09 11:20 ` Philipp Zabel
2015-11-09 11:43 ` Russell King - ARM Linux
2015-11-09 11:57 ` Liviu Dudau
2015-11-09 12:03 ` Russell King - ARM Linux
2015-11-09 12:07 ` Liviu Dudau
2015-11-09 19:49 ` Heiko Stuebner
[not found] ` <5641B075.6020602@rock-chips.com>
2015-11-10 10:09 ` Liviu Dudau
2015-11-09 11:15 ` Russell King - ARM Linux [this message]
2015-10-19 15:07 ` [RFC PATCH v3 2/4] drm/imx: Convert the probe function to the generic drm_of_component_probe() Liviu Dudau
2015-10-19 15:15 ` Russell King - ARM Linux
2015-10-19 15:07 ` [RFC PATCH v3 3/4] drm/rockchip: " Liviu Dudau
2015-10-19 15:07 ` [RFC PATCH v3 4/4] drm/armada: " Liviu Dudau
2015-10-19 15:17 ` Russell King - ARM Linux
2015-10-19 15:23 ` Liviu Dudau
2015-10-19 22:07 ` kbuild test robot
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=20151109111515.GW8644@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=Liviu.Dudau@arm.com \
--cc=airlied@linux.ie \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=heiko@sntech.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mark.yao@rock-chips.com \
--cc=p.zabel@pengutronix.de \
/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
all inboxes | Powered by JetHome®