From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
To: Leela Krishna Amudala <l.krishna@samsung.com>
Cc: devicetree-discuss@lists.ozlabs.org,
Rob Herring <robherring2@gmail.com>,
linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Thierry Reding <thierry.reding@avionic-design.de>,
Guennady Liakhovetski <g.liakhovetski@gmx.de>,
linux-media@vger.kernel.org,
Tomi Valkeinen <tomi.valkeinen@ti.com>,
Stephen Warren <swarren@wwwdotorg.org>,
kernel@pengutronix.de
Subject: Re: [PATCH v7 2/8] of: add helper to parse display timings
Date: Sun, 4 Nov 2012 18:23:13 +0100 [thread overview]
Message-ID: <20121104172312.GC5894@pengutronix.de> (raw)
In-Reply-To: <CAL1wa8dGiS-UDk7vjPKBaxQHB2FyNgLRYr5jsJZe4GjdzHELLQ@mail.gmail.com>
Hi!
On Fri, Nov 02, 2012 at 10:49:47PM +0530, Leela Krishna Amudala wrote:
> Hello Steffen,
>
> On Wed, Oct 31, 2012 at 2:58 PM, Steffen Trumtrar
> > +static int parse_property(struct device_node *np, char *name,
> > + struct timing_entry *result)
> > +{
> > + struct property *prop;
> > + int length;
> > + int cells;
> > + int ret;
> > +
> > + prop = of_find_property(np, name, &length);
> > + if (!prop) {
> > + pr_err("%s: could not find property %s\n", __func__, name);
> > + return -EINVAL;
> > + }
> > +
> > + cells = length / sizeof(u32);
> > + if (cells == 1) {
> > + ret = of_property_read_u32_array(np, name, &result->typ, cells);
>
> As you are reading only one vaue, you can use of_property_read_u32 instead.
>
Yes, thats copypasta, no need for _array here.
> > + result->min = result->typ;
> > + result->max = result->typ;
> > + } else if (cells == 3) {
> > + ret = of_property_read_u32_array(np, name, &result->min, cells);
>
> You are considering only min element, what about typ and max elements?
>
I start at the address of result->min and read three u32-values, therefore all
three (min,typ,max) are filled with values.
> > +
> > +/**
> > + * of_display_timings_exists - check if a display-timings node is provided
> > + * @np: device_node with the timing
> > + **/
> > +int of_display_timings_exists(struct device_node *np)
> > +{
> > + struct device_node *timings_np;
> > + struct device_node *default_np;
> > +
> > + if (!np)
> > + return -EINVAL;
> > +
> > + timings_np = of_parse_phandle(np, "display-timings", 0);
> > + if (!timings_np)
> > + return -EINVAL;
> > +
> > + return -EINVAL;
>
> Here it should return success instead of -EINVAL.
>
Yes.
> And one query.. are the binding properties names and "display-timings"
> node structure template finalized..?
>
I sure hope so. There actually is one error in the examples though.
The property clock is called clock-frequency. I included it correctly
at the top of display-timings.txt, but overlooked it in the examples.
Regards,
Steffen
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2012-11-04 17:23 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-31 9:28 [PATCH v7 0/8] of: add display helper Steffen Trumtrar
2012-10-31 9:28 ` [PATCH v7 1/8] video: add display_timing struct and helpers Steffen Trumtrar
2012-10-31 17:04 ` Laurent Pinchart
2012-10-31 17:09 ` Laurent Pinchart
2012-11-01 20:08 ` Thierry Reding
2012-11-04 16:53 ` Steffen Trumtrar
2012-10-31 9:28 ` [PATCH v7 2/8] of: add helper to parse display timings Steffen Trumtrar
2012-11-01 17:52 ` Stephen Warren
2012-11-01 20:15 ` Thierry Reding
2012-11-04 17:10 ` Steffen Trumtrar
2012-11-02 17:19 ` Leela Krishna Amudala
2012-11-04 17:23 ` Steffen Trumtrar [this message]
2012-10-31 9:28 ` [PATCH v7 3/8] of: add generic videomode description Steffen Trumtrar
2012-11-01 20:17 ` Thierry Reding
2012-10-31 9:28 ` [PATCH v7 4/8] video: add videomode helpers Steffen Trumtrar
2012-10-31 17:18 ` Laurent Pinchart
2012-10-31 9:28 ` [PATCH v7 5/8] fbmon: " Steffen Trumtrar
2012-10-31 15:30 ` Manjunathappa, Prakash
2012-10-31 16:49 ` Steffen Trumtrar
2012-11-08 21:25 ` Steffen Trumtrar
2012-11-09 16:54 ` Manjunathappa, Prakash
2012-11-09 19:31 ` Steffen Trumtrar
2012-11-12 11:46 ` Laurent Pinchart
2012-10-31 9:28 ` [PATCH v7 6/8] fbmon: add of_videomode helpers Steffen Trumtrar
2012-10-31 9:28 ` [PATCH v7 7/8] drm_modes: add videomode helpers Steffen Trumtrar
2012-10-31 9:28 ` [PATCH v7 8/8] drm_modes: add of_videomode helpers Steffen Trumtrar
2012-11-05 9:10 ` Thierry Reding
2012-11-08 21:35 ` [PATCH v7 0/8] of: add display helper Rob Herring
2012-11-09 8:22 ` Steffen Trumtrar
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=20121104172312.GC5894@pengutronix.de \
--to=s.trumtrar@pengutronix.de \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=g.liakhovetski@gmx.de \
--cc=kernel@pengutronix.de \
--cc=l.krishna@samsung.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=robherring2@gmail.com \
--cc=swarren@wwwdotorg.org \
--cc=thierry.reding@avionic-design.de \
--cc=tomi.valkeinen@ti.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).