aboutsummaryrefslogtreecommitdiff
path: root/fdtget.c
AgeCommit message (Collapse)AuthorFilesLines
2016-07-24fdtget.c: Fix memory leakJean-Christophe Dubois1-1/+7
CID 132823 (#1 of 1): Resource leak (RESOURCE_LEAK) 5. leaked_storage: Variable blob going out of scope leaks the storage it points to. Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2013-05-24util: drop "long" from usage helpersMike Frysinger1-3/+3
Now that all utils have converted to the new usage framework, we can rename to just plain "usage()" and avoid naming conflicts. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2013-05-24dtc/fdt{get, put}/convert-dtsv0-lexer: convert to new usage helpersMike Frysinger1-33/+27
This helps standardize the flag processing and the usage screens. Only lightly tested; would be great if someone who uses these utils could double check. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2013-04-22Revert "utilfdt_read: pass back up the length of data read"Jon Loeliger1-1/+1
This reverts commit cc2c178727cdeca4eb9756637c2e09e50e0856e7. It was the wrong version of the patch.
2013-04-21utilfdt_read: pass back up the length of data readMike Frysinger1-1/+1
For a follow up commit, we want to be able to scan the buffer that was returned to us. In order to do that safely, we need to know how big the buffer actually is, so pass that back if requested. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-07fdtget: Add -d to provide a default valueSimon Glass1-3/+17
Sometimes the requested node or property is not present in the device tree. This option provides a way of reporting a default value in this case, rather than halting with an error. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: David Gibson <david@gibson.dropbear.id.au>
2012-03-07fdtget: Add -l to list the subnodes of a nodeSimon Glass1-12/+84
This option lists the subnodes of each node given as a parameter, one subnode per line. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: David Gibson <david@gibson.dropbear.id.au>
2012-03-07fdtget: Add -p to list the properties of a nodeSimon Glass1-6/+60
This option lists the properties of each node given as a parameter, one property per line. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: David Gibson <david@gibson.dropbear.id.au>
2012-03-07fdtget: Fix multiple arg bug and add test for itSimon Glass1-3/+3
There is a rather unfortunate bug in fdtget in that if multiple argument sets are provided, it just repeats displaying the first set ones for each set. Fix this bug and add a test for it. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: David Gibson <david@gibson.dropbear.id.au>
2012-02-03Trivial style fixupDavid Gibson1-2/+2
Having braces on an if branch but not the else branch, or vice versa is ugly and can trick you when reading the code. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2012-01-21Add fdtget utility to read property values from a device treeSimon Glass1-0/+226
This simply utility makes it easy for scripts to read values from the device tree. It is written in C and uses the same libfdt as the rest of the dtc package. What is it for: - Reading fdt values from scripts - Extracting fdt information within build systems - Looking at particular values without having to dump the entire tree To use it, specify the fdt binary file on command line followed by a list of node, property pairs. The utility then looks up each node, finds the property and displays the value. Each value is printed on a new line. fdtget tries to guess the type of each property based on its contents. This is not always reliable, so you can use the -t option to force fdtget to decode the value as a string, or byte, etc. To read from stdin, use - as the file. Usage: fdtget <options> <dt file> [<node> <property>]... Options: -t <type> Type of data -h Print this help <type> s=string, i=int, u=unsigned, x=hex Optional modifier prefix: hh or b=byte, h=2 byte, l=4 byte (default) Signed-off-by: Simon Glass <sjg@chromium.org>