MIPS: of: Introduce helper function to get DTB
Selection of the DTB to be used was burried in more or less readable code in head.S. Move this code into a inline helper function and use it. Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Acked-by: Florian Fainelli <f.fainelli@gmail.com>
This commit is contained in:
@ -39,14 +39,13 @@ void __init *plat_get_fdt(void)
|
||||
/* Already set up */
|
||||
return (void *)fdt;
|
||||
|
||||
if (fw_passed_dtb && !fdt_check_header((void *)fw_passed_dtb)) {
|
||||
fdt = (void *)get_fdt();
|
||||
if (fdt && !fdt_check_header(fdt)) {
|
||||
/*
|
||||
* We have been provided with the appropriate device tree for
|
||||
* the board. Make use of it & search for any machine struct
|
||||
* based upon the root compatible string.
|
||||
*/
|
||||
fdt = (void *)fw_passed_dtb;
|
||||
|
||||
for_each_mips_machine(check_mach) {
|
||||
match = mips_machine_is_compatible(check_mach, fdt);
|
||||
if (match) {
|
||||
|
Reference in New Issue
Block a user