From 5a75e121075a63f312ae07409477b6f686840a93 Mon Sep 17 00:00:00 2001 From: John Rigby Date: Wed, 13 Oct 2010 13:57:34 -0600 Subject: FDT: only call boot_get_fdt from generic code All arches except nios2 and microblaze call boot_get_fdt from bootm_start in common/cmd_bootm.c. Having nios2 and microblaze do so as well removes code from their respective do_bootm_linux routines and allows removal of a nasty ifdef from bootm_start. In the case where boot_get_fdt returns an error bootm_start returns and the platform specific do_bootm_linux routines will never get called. Also only check argv[3] for an fdt addr if argc > 3 first. This is already the case for nios2. Signed-off-by: John Rigby CC: Scott McNutt CC: Michal Simek CC: Thomas Chou Acked-by: Wolfgang Denk Acked-by: Michal Simek Tested-by: Thomas Chou --- arch/nios2/lib/bootm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'arch/nios2') diff --git a/arch/nios2/lib/bootm.c b/arch/nios2/lib/bootm.c index 40a4d1502..f32be5210 100644 --- a/arch/nios2/lib/bootm.c +++ b/arch/nios2/lib/bootm.c @@ -36,11 +36,9 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima ulong initrd_end = images->rd_end; char *of_flat_tree = NULL; #if defined(CONFIG_OF_LIBFDT) - ulong of_size = 0; - - /* find flattened device tree */ - if (boot_get_fdt(flag, argc, argv, images, &of_flat_tree, &of_size)) - return 1; + /* did generic code already find a device tree? */ + if (images->ft_len) + of_flat_tree = images->ft_addr; #endif if (!of_flat_tree && argc > 3) of_flat_tree = (char *)simple_strtoul(argv[3], NULL, 16); -- cgit v1.2.3