Skip to content

Commit

Permalink
of: Split early_init_dt_scan into two parts
Browse files Browse the repository at this point in the history
Currently, early_init_dt_scan validates the header, sets the
boot params, and scans for chosen/memory all in one function.
Split this up into two separate functions (validation/setting
boot params in one, scanning in another) to allow for
additional setup between boot params and scanning the memory.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Tested-by: Andreas Färber <afaerber@suse.de>
[glikely: s/early_init_dt_scan_all/early_init_dt_scan_nodes/]
Signed-off-by: Grant Likely <grant.likely@linaro.org>
  • Loading branch information
Laura Abbott authored and Grant Likely committed Jul 30, 2014
1 parent 64aa90f commit 4972a74
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 17 additions & 1 deletion drivers/of/fdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
}
#endif

bool __init early_init_dt_scan(void *params)
bool __init early_init_dt_verify(void *params)
{
if (!params)
return false;
Expand All @@ -951,6 +951,12 @@ bool __init early_init_dt_scan(void *params)
return false;
}

return true;
}


void __init early_init_dt_scan_nodes(void)
{
/* Retrieve various information from the /chosen node */
of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line);

Expand All @@ -959,7 +965,17 @@ bool __init early_init_dt_scan(void *params)

/* Setup memory, calling early_init_dt_add_memory_arch */
of_scan_flat_dt(early_init_dt_scan_memory, NULL);
}

bool __init early_init_dt_scan(void *params)
{
bool status;

status = early_init_dt_verify(params);
if (!status)
return false;

early_init_dt_scan_nodes();
return true;
}

Expand Down
2 changes: 2 additions & 0 deletions include/linux/of_fdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ extern int early_init_dt_scan_root(unsigned long node, const char *uname,
int depth, void *data);

extern bool early_init_dt_scan(void *params);
extern bool early_init_dt_verify(void *params);
extern void early_init_dt_scan_nodes(void);

extern const char *of_flat_dt_get_machine_name(void);
extern const void *of_flat_dt_match_machine(const void *default_match,
Expand Down

0 comments on commit 4972a74

Please sign in to comment.