From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick DELAUNAY Date: Thu, 9 Jan 2020 08:29:55 +0000 Subject: [PATCH v2 02/14] dm: core: add ofnode and dev function to iterate on node property In-Reply-To: References: <20191126084911.19761-1-patrick.delaunay@st.com> <20191126084911.19761-3-patrick.delaunay@st.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de Hi, > From: Simon Glass > Sent: lundi 30 d=C3=A9cembre 2019 02:21 >=20 > On Tue, 26 Nov 2019 at 01:49, Patrick Delaunay > wrote: > > > > Add functions to iterate on all property with livetree > > - dev_read_first_prop > > - dev_read_next_prop > > - dev_read_prop_by_prop > > and > > - ofnode_get_first_property > > - ofnode_get_next_property > > - ofnode_get_property_by_prop > > > > For example: > > struct ofprop property; > > > > dev_for_each_property(property, config) { > > value =3D dev_read_prop_by_prop(&property, &propname, &len); > > > > or: > > for (prop =3D ofnode_get_first_property(dev_ofnode(dev)); > > prop; > > prop =3D ofnode_get_next_property(dev_ofnode(dev),prop)) > > { > > value =3D ofnode_get_property_by_prop(dev_ofnode(dev), prop, > > &propname, &len); .... > > } > > > > Signed-off-by: Patrick Delaunay > > --- > > > > Changes in v2: > > - Identify property with a new struct ofprop as proposed > > by Simon Glass > > - Add dev_ iterate functions > > > > drivers/core/of_access.c | 32 +++++++++++++++++++ > > drivers/core/ofnode.c | 48 ++++++++++++++++++++++++++++ > > drivers/core/read.c | 16 ++++++++++ > > include/dm/of_access.h | 40 ++++++++++++++++++++++++ > > include/dm/ofnode.h | 63 ++++++++++++++++++++++++++++++++++++- > > include/dm/read.h | 67 > ++++++++++++++++++++++++++++++++++++++++ > > 6 files changed, 265 insertions(+), 1 deletion(-) >=20 > These look good, but please add a few simple tests like in your commit me= ssage. >=20 > See test/dm/ofnode.c, or you could add test/dm/read.c and just use the re= ad > interface which would be good enough It think, since tests run with and w= ithout > livetree. Ok I will add it. Regards Patrick