public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Prabhakar Lad <prabhakar.csengg@gmail.com>
Cc: LMML <linux-media@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	DLOS <davinci-linux-open-source@linux.davincidsp.com>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Mauro Carvalho Chehab <mchehab@redhat.com>,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Sakari Ailus <sakari.ailus@iki.fi>,
	Grant Likely <grant.likely@secretlab.ca>,
	Rob Herring <rob.herring@calxeda.com>,
	Rob Landley <rob@landley.net>,
	devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH v3] media: i2c: tvp514x: add OF support
Date: Thu, 16 May 2013 14:50:06 +0200	[thread overview]
Message-ID: <2750806.COjXX3GeT0@avalon> (raw)
In-Reply-To: <CA+V-a8ti58gdPR-fUEqgBvUQ=1GkoTUyLj9UK4D5aVwHv2R6mA@mail.gmail.com>

Hi Prabhakar,

On Thursday 16 May 2013 18:13:38 Prabhakar Lad wrote:
> On Thu, May 16, 2013 at 5:40 PM, Laurent Pinchart wrote:
> > Hi Prabhakar,
> 
> [Snip]
> 
> >> +
> >> +     pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
> >> +     if (!pdata)
> > 
> > I've started playing with the V4L2 OF bindings, and realized that should
> > should call of_node_put() here.
> 
> you were referring  of_node_get() here rite ?

No, I'm referring to of_node_put(). The v4l2_of_get_next_endpoint() function 
mentions

 * Return: An 'endpoint' node pointer with refcount incremented. Refcount
 * of the passed @prev node is not decremented, the caller have to use
 * of_node_put() on it when done.

> of_node_get/put() got recently added I guess coz of which I missed it :)
> 
> >> +             return NULL;
> >> +
> >> +     v4l2_of_parse_endpoint(endpoint, &bus_cfg);
> >> +     flags = bus_cfg.bus.parallel.flags;
> >> +
> >> +     if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)
> >> +             pdata->hs_polarity = 1;
> >> +
> >> +     if (flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH)
> >> +             pdata->vs_polarity = 1;
> >> +
> >> +     if (flags & V4L2_MBUS_PCLK_SAMPLE_RISING)
> >> +             pdata->clk_polarity = 1;
> >> +
> > 
> > As well as here. Maybe a
> > 
> > done:
> >         of_node_put(endpoint);
> >         return pdata;
> > 
> > with a goto done in the devm_kzalloc error path would be better.

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2013-05-16 12:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-14 11:00 [PATCH v3] media: i2c: tvp514x: add OF support Lad Prabhakar
2013-05-16 12:10 ` Laurent Pinchart
2013-05-16 12:43   ` Prabhakar Lad
2013-05-16 12:50     ` Laurent Pinchart [this message]
2013-05-16 12:53       ` Prabhakar Lad
2013-05-23  9:45 ` Hans Verkuil

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=2750806.COjXX3GeT0@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=g.liakhovetski@gmx.de \
    --cc=grant.likely@secretlab.ca \
    --cc=hans.verkuil@cisco.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=prabhakar.csengg@gmail.com \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=s.nawrocki@samsung.com \
    --cc=sakari.ailus@iki.fi \
    /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