From 9b4d2b635bd0cf8dfc45223f66fd85792fd2dc7b Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Tue, 14 May 2019 13:40:52 -0700 Subject: of/fdt: Remove dead code and mark functions with __init Some functions in here are never called, and others are only called during __init. Remove the dead code and some dead exports for functions that don't exist (I'm looking at you of_fdt_get_string!). Mark some functions with __init so we can throw them away after we boot up and poke at the FDT blob too. Cc: Hsin-Yi Wang Signed-off-by: Stephen Boyd Signed-off-by: Rob Herring --- drivers/of/fdt.c | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) (limited to 'drivers/of') diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index de893c9616a1..918098c9f72a 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -38,7 +38,7 @@ * memory entries in the /memory node. This function may be called * any time after initial_boot_param is set. */ -void of_fdt_limit_memory(int limit) +void __init of_fdt_limit_memory(int limit) { int memory; int len; @@ -110,25 +110,6 @@ static int of_fdt_is_compatible(const void *blob, return 0; } -/** - * of_fdt_is_big_endian - Return true if given node needs BE MMIO accesses - * @blob: A device tree blob - * @node: node to test - * - * Returns true if the node has a "big-endian" property, or if the kernel - * was compiled for BE *and* the node has a "native-endian" property. - * Returns false otherwise. - */ -bool of_fdt_is_big_endian(const void *blob, unsigned long node) -{ - if (fdt_getprop(blob, node, "big-endian", NULL)) - return true; - if (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN) && - fdt_getprop(blob, node, "native-endian", NULL)) - return true; - return false; -} - static bool of_fdt_device_is_available(const void *blob, unsigned long node) { const char *status = fdt_getprop(blob, node, "status", NULL); @@ -145,8 +126,8 @@ static bool of_fdt_device_is_available(const void *blob, unsigned long node) /** * of_fdt_match - Return true if node matches a list of compatible values */ -int of_fdt_match(const void *blob, unsigned long node, - const char *const *compat) +static int __init of_fdt_match(const void *blob, unsigned long node, + const char *const *compat) { unsigned int tmp, score = 0; @@ -758,7 +739,7 @@ int __init of_scan_flat_dt_subnodes(unsigned long parent, * @return offset of the subnode, or -FDT_ERR_NOTFOUND if there is none */ -int of_get_flat_dt_subnode_by_name(unsigned long node, const char *uname) +int __init of_get_flat_dt_subnode_by_name(unsigned long node, const char *uname) { return fdt_subnode_offset(initial_boot_params, node, uname); } @@ -771,14 +752,6 @@ unsigned long __init of_get_flat_dt_root(void) return 0; } -/** - * 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 * @@ -804,7 +777,7 @@ int __init of_flat_dt_is_compatible(unsigned long node, const char *compat) /** * of_flat_dt_match - Return true if node matches a list of compatible values */ -int __init of_flat_dt_match(unsigned long node, const char *const *compat) +static int __init of_flat_dt_match(unsigned long node, const char *const *compat) { return of_fdt_match(initial_boot_params, node, compat); } -- cgit v1.2.3-55-g7522