From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: linux-media@vger.kernel.org, linux-omap@vger.kernel.org,
tony@atomide.com, sre@kernel.org, pali.rohar@gmail.com
Subject: Re: [PATCH v1.1 14/15] omap3isp: Add support for the Device Tree
Date: Sun, 22 Mar 2015 22:26:39 +0200 [thread overview]
Message-ID: <3913985.bpC1SiT8Tn@avalon> (raw)
In-Reply-To: <1426889104-17921-1-git-send-email-sakari.ailus@iki.fi>
Hi Sakari,
Thank you for the patch. This looks good to me, except that there's one last
bug I've spotted. Please see below.
On Saturday 21 March 2015 00:05:04 Sakari Ailus wrote:
> Add the ISP device to omap3 DT include file and add support to the driver to
> use it.
>
> Also obtain information on the external entities and the ISP configuration
> related to them through the Device Tree in addition to the platform data.
>
> Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
> ---
> since v1:
>
> - Print endpoint name in debug message when parsing an endpoint.
>
> - Rename lane-polarity property as lane-polarities.
>
> - Print endpoint name with the interface if the interface is invalid.
>
> - Remove assignment to two variables at the same time.
>
> - Fix multiple sub-device support in isp_of_parse_nodes().
>
> - Put of_node properly in isp_of_parse_nodes() (requires Philipp Zabel's
> patch "of: Decrement refcount of previous endpoint in
> of_graph_get_next_endpoint".
>
> - Rename return value variable rval as ret to be consistent with the rest of
> the driver.
>
> - Read the register offset from the syscom property's first argument.
>
> drivers/media/platform/omap3isp/isp.c | 218 ++++++++++++++++++++++--
> drivers/media/platform/omap3isp/isp.h | 11 ++
> drivers/media/platform/omap3isp/ispcsiphy.c | 7 +
> 3 files changed, 224 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/media/platform/omap3isp/isp.c
> b/drivers/media/platform/omap3isp/isp.c index 992e74c..92a859e 100644
> --- a/drivers/media/platform/omap3isp/isp.c
> +++ b/drivers/media/platform/omap3isp/isp.c
[snip]
> +static int isp_of_parse_nodes(struct device *dev,
> + struct v4l2_async_notifier *notifier)
> +{
> + struct device_node *node;
> +
> + notifier->subdevs = devm_kcalloc(
> + dev, ISP_MAX_SUBDEVS, sizeof(*notifier->subdevs), GFP_KERNEL);
> + if (!notifier->subdevs)
> + return -ENOMEM;
> +
> + while ((node = of_graph_get_next_endpoint(dev->of_node, node)) &&
> + notifier->num_subdevs < ISP_MAX_SUBDEVS) {
If the first condition evaluates to true and the second one to false, the loop
will be exited without releasing the reference to the DT node. You could just
switch the two conditions to fix this.
> + struct isp_async_subdev *isd;
> +
> + isd = devm_kzalloc(dev, sizeof(*isd), GFP_KERNEL);
> + if (!isd) {
> + of_node_put(node);
> + return -ENOMEM;
> + }
> +
> + notifier->subdevs[notifier->num_subdevs] = &isd->asd;
> +
> + if (isp_of_parse_node(dev, node, isd)) {
> + of_node_put(node);
> + return -EINVAL;
> + }
> +
> + isd->asd.match.of.node = of_graph_get_remote_port_parent(node);
> + of_node_put(node);
> + if (!isd->asd.match.of.node) {
> + dev_warn(dev, "bad remote port parent\n");
> + return -EINVAL;
> + }
> +
> + isd->asd.match_type = V4L2_ASYNC_MATCH_OF;
> + notifier->num_subdevs++;
> + }
> +
> + return notifier->num_subdevs;
> +}
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2015-03-23 6:23 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-16 0:25 [PATCH 00/15] omap3isp driver DT support Sakari Ailus
2015-03-16 0:25 ` [PATCH 01/15] omap3isp: Fix error handling in probe Sakari Ailus
2015-03-16 0:25 ` [PATCH 02/15] omap3isp: Avoid a BUG_ON() in media_entity_create_link() Sakari Ailus
2015-03-16 0:25 ` [PATCH 03/15] omap3isp: Separate external link creation from platform data parsing Sakari Ailus
2015-03-16 0:25 ` [PATCH 04/15] omap3isp: DT support for clocks Sakari Ailus
2015-03-16 0:26 ` [PATCH 05/15] omap3isp: Platform data could be NULL Sakari Ailus
2015-03-16 0:26 ` [PATCH 06/15] omap3isp: Refactor device configuration structs for Device Tree Sakari Ailus
2015-03-19 7:04 ` Igor Grinberg
2015-03-16 0:26 ` [PATCH 07/15] omap3isp: Rename regulators to better suit the " Sakari Ailus
2015-03-16 0:26 ` [PATCH 08/15] omap3isp: Calculate vpclk_div for CSI-2 Sakari Ailus
2015-03-16 0:26 ` [PATCH 09/15] omap3isp: Replace mmio_base_phys array with the histogram block base Sakari Ailus
2015-03-16 0:26 ` [PATCH 10/15] omap3isp: Move the syscon register out of the ISP register maps Sakari Ailus
2015-03-22 12:17 ` [PATCH v1.1 " Sakari Ailus
2015-03-16 0:26 ` [PATCH 11/15] omap3isp: Replace many MMIO regions by two Sakari Ailus
2015-03-16 0:26 ` [PATCH 12/15] dt: bindings: Add lane-polarity property to endpoint nodes Sakari Ailus
2015-03-16 8:58 ` Laurent Pinchart
2015-03-20 22:07 ` [PATCH v1.1 " Sakari Ailus
2015-03-16 0:26 ` [PATCH 13/15] v4l: of: Read lane-polarity endpoint property Sakari Ailus
2015-03-16 9:05 ` Laurent Pinchart
2015-03-16 23:12 ` Sakari Ailus
2015-03-20 22:08 ` [PATCH v1.1 13/15] v4l: of: Read lane-polarities " Sakari Ailus
2015-03-22 8:46 ` Laurent Pinchart
2015-03-16 0:26 ` [PATCH 14/15] omap3isp: Add support for the Device Tree Sakari Ailus
2015-03-17 0:48 ` Laurent Pinchart
2015-03-20 21:04 ` Sakari Ailus
2015-03-20 22:05 ` [PATCH v1.1 " Sakari Ailus
2015-03-22 12:23 ` Sakari Ailus
2015-03-22 20:26 ` Laurent Pinchart [this message]
2015-03-25 22:38 ` Sakari Ailus
2015-03-16 0:26 ` [PATCH 15/15] omap3isp: Deprecate platform data support Sakari Ailus
2015-03-17 0:49 ` Laurent Pinchart
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=3913985.bpC1SiT8Tn@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=pali.rohar@gmail.com \
--cc=sakari.ailus@iki.fi \
--cc=sre@kernel.org \
--cc=tony@atomide.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