diff options
author | Simon Glass <sjg@chromium.org> | 2011-11-17 14:30:06 -0800 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2011-11-18 16:21:36 -0800 |
commit | a4a24c8a87ee3121bde71dde04e58b699670761d (patch) | |
tree | 4fa930ff7a747881ae5a0941e77fc193834070c1 /include/fdt_decode.h | |
parent | 318c9b21768d937e4a8984af86fec6fcd02242f2 (diff) |
Tidy up fdt_decode_alloc_region() to make alloc separate
Move the malloc() out of fdt_decode_alloc_region() and rename it
accordingly. This makes the code somewhat cleaner and allows us
to print a sensible error message.
BUG=chromium-os:17062
TEST=build and boot on Kaen
Change-Id: I8edc8809baa42578e74c5e42cf47494b31b774e7
Reviewed-on: https://gerrit.chromium.org/gerrit/11878
Commit-Ready: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/fdt_decode.h')
-rw-r--r-- | include/fdt_decode.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/fdt_decode.h b/include/fdt_decode.h index e787b902bf4..6087c218617 100644 --- a/include/fdt_decode.h +++ b/include/fdt_decode.h @@ -600,8 +600,7 @@ int fdt_decode_nand(const void *blob, int node, struct fdt_nand *config); /** * Look up a property in a node which contains a memory region address and - * size. Then return a pointer to this address. if the address is zero, it is - * allocated with malloc() instead. + * size. Then return a pointer to this address. * * The property must hold one address with a length. This is only tested on * 32-bit machines. @@ -609,8 +608,9 @@ int fdt_decode_nand(const void *blob, int node, struct fdt_nand *config); * @param blob FDT blob * @param node node to examine * @param prop_name name of property to find + * @param ptrp returns pointer to region, or NULL if no address * @param size returns size of region - * @return pointer to region, or NULL if property not found/malloc failed + * @return 0 if ok, -1 on error (propery not found) */ -void *fdt_decode_alloc_region(const void *blob, int node, - const char *prop_name, size_t *size); +int fdt_decode_region(const void *blob, int node, + const char *prop_name, void **ptrp, size_t *size); |