[DTC PATCH] libfdt: Add ft_get_next_node(), ft_get_next_prop(), and ft_getprop_offset().
Stephen Rothwell
sfr at canb.auug.org.au
Tue Jan 15 09:31:49 EST 2008
Hi Scott,
On Mon, 14 Jan 2008 10:30:04 -0600 Scott Wood <scottwood at freescale.com> wrote:
>
> ft_get_next_node() enumerates children of a given node.
> ft_get_next_prop() enumerates propreties of a given node.
^^^^^^^^^^
typo.
> ft_getprop_offset() is like ft_getprop(), but takes a property offset rather
> than a node offset and property name; it is primarily intended for use
> with ft_get_next_prop().
All the "ft_" above should be "fdt_".
> +const void *fdt_getprop_offset(const void *fdt, int propoffset,
> + const char **name, int *lenp)
> +{
> + tag = fdt_next_tag(fdt,propoffset, NULL);
^
space after ','
> +++ b/libfdt/libfdt.h
> +#define FDT_ERR_BADDEPTH 8
Wouldn't it have been less intrusive to just use the next error number
rather than inserting this here?
> + * fdt_getprop_offset - retrieve the value of a given property by offset
> + * @fdt: pointer to the device tree blob
> + * @propoffset: offset of the property to read
> + * @name: pointer to a character pointer (will be overwritten) or NULL
^^^^^^^^^^^^^^^^^
"string"?
> + * @lenp: pointer to an integer variable (will be overwritten) or NULL
> + *
> + * fdt_getprop() retrieves a pointer to the value of the property
fdt_getprop_offset
> + * named 'name' of the node at offset nodeoffset (this will be a
> + * pointer to within the device blob itself, not a copy of the value).
> + * If lenp is non-NULL, the length of the property value also
> + * returned, in the integer pointed to by lenp.
> + *
> + * returns:
> + * pointer to the property's value
if name is non-NULL, *name points to ...
> + * if lenp is non-NULL, *lenp contains the length of the property
> + * value (>=0)
--
Cheers,
Stephen Rothwell sfr at canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20080115/c473486c/attachment.pgp>
More information about the Linuxppc-dev
mailing list