From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Fri, 17 Apr 2020 17:05:55 -0400 Subject: [PATCH v3 02/21] dm: core: add ofnode and dev function to iterate on node property In-Reply-To: <20200113103515.20879-3-patrick.delaunay@st.com> References: <20200113103515.20879-1-patrick.delaunay@st.com> <20200113103515.20879-3-patrick.delaunay@st.com> Message-ID: <20200417210555.GI4555@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, Jan 13, 2020 at 11:34:56AM +0100, 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 > > And helper: dev_for_each_property > > For example: > struct ofprop property; > > dev_for_each_property(property, config) { > value = dev_read_prop_by_prop(&property, &propname, &len); > > or: > > for (res = ofnode_get_first_property(node, &property); > !res; > res = ofnode_get_next_property(&property)) > { > value = ofnode_get_property_by_prop(&property, &propname, &len); > .... > } > > Signed-off-by: Patrick Delaunay > Reviewed-by: Simon Glass Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: