summaryrefslogtreecommitdiffstats
path: root/drivers/of/fdt.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2014-04-22 12:55:10 -0500
committerRob Herring <robh@kernel.org>2014-04-30 00:59:18 -0500
commitc0556d3f2c3f42eaed049139ce6f0899ecdb0217 (patch)
tree9bfbb3c61b640a8492e95f0cdff10c9734376c09 /drivers/of/fdt.c
parent1d1a661da4c8468b3fa6f567b2b1f8cdeafa847a (diff)
downloadop-kernel-dev-c0556d3f2c3f42eaed049139ce6f0899ecdb0217.zip
op-kernel-dev-c0556d3f2c3f42eaed049139ce6f0899ecdb0217.tar.gz
of/fdt: introduce of_get_flat_dt_size
Add a wrapper function to retrieve the FDT size from the FDT header. This is primarily to avoid libfdt include paths for the whole kernel. Signed-off-by: Rob Herring <robh@kernel.org> Tested-by: Grant Likely <grant.likely@linaro.org> Tested-by: Stephen Chivers <schivers@csc.com>
Diffstat (limited to 'drivers/of/fdt.c')
-rw-r--r--drivers/of/fdt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index d9e6450..358bcf0 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -554,6 +554,14 @@ unsigned long __init of_get_flat_dt_root(void)
}
/**
+ * of_get_flat_dt_size - Return the total size of the FDT
+ */
+int __init of_get_flat_dt_size(void)
+{
+ return fdt_totalsize(initial_boot_params);
+}
+
+/**
* of_get_flat_dt_prop - Given a node in the flat blob, return the property ptr
*
* This function can be used within scan_flattened_dt callback to get
OpenPOWER on IntegriCloud