From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jon Loeliger Subject: Re: libfdt: Implement property iteration functions Date: Wed, 10 Mar 2010 08:17:01 -0600 Message-ID: References: <20100309063914.GA11655@yookeroo> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-reply-to: <20100309063914.GA11655@yookeroo> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: David Gibson Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org List-Id: devicetree@vger.kernel.org > For ages, we've been talking about adding functions to libfdt to allow > iteration through properties. So, finally, here are some. > > I got bogged down on this for a long time because I didn't want to > expose offsets directly to properties to the callers. But without > that, attempting to make reasonable iteration functions just became > horrible. So eventually, I settled on an interface which does now > expose property offsets. fdt_first_property_offset() and > fdt_next_property_offset() are used to step through the offsets of the > properties starting from a particularly node offset. The details of > the property at each offset can then be retrieved with either > fdt_get_property_by_offset() or fdt_getprop_by_offset() which have > interfaces similar to fdt_get_property() and fdt_getprop() > respectively. > > No explicit testcases are included, but we do use the new functions to > reimplement the existing fdt_get_property() function. > > Signed-off-by: David Gibson Applied. jdl