mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
sunxi: board: Use a more descriptive variable name
The variable "cmp_str" always leaves me wondering if it is the DT name of the current board (yes) or DT name in the FIT config entry (no). In preparation for expanding the functionality here, rename it to something that obviously means "this is the DT name we are looking for". Acked-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
This commit is contained in:
parent
9324c9a823
commit
2fcd74899c
1 changed files with 6 additions and 6 deletions
|
@ -892,14 +892,14 @@ int ft_board_setup(void *blob, struct bd_info *bd)
|
||||||
int board_fit_config_name_match(const char *name)
|
int board_fit_config_name_match(const char *name)
|
||||||
{
|
{
|
||||||
struct boot_file_head *spl = get_spl_header(SPL_DT_HEADER_VERSION);
|
struct boot_file_head *spl = get_spl_header(SPL_DT_HEADER_VERSION);
|
||||||
const char *cmp_str = (const char *)spl;
|
const char *best_dt_name = (const char *)spl;
|
||||||
|
|
||||||
/* Check if there is a DT name stored in the SPL header and use that. */
|
/* Check if there is a DT name stored in the SPL header and use that. */
|
||||||
if (spl != INVALID_SPL_HEADER && spl->dt_name_offset) {
|
if (spl != INVALID_SPL_HEADER && spl->dt_name_offset) {
|
||||||
cmp_str += spl->dt_name_offset;
|
best_dt_name += spl->dt_name_offset;
|
||||||
} else {
|
} else {
|
||||||
#ifdef CONFIG_DEFAULT_DEVICE_TREE
|
#ifdef CONFIG_DEFAULT_DEVICE_TREE
|
||||||
cmp_str = CONFIG_DEFAULT_DEVICE_TREE;
|
best_dt_name = CONFIG_DEFAULT_DEVICE_TREE;
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
|
@ -907,15 +907,15 @@ int board_fit_config_name_match(const char *name)
|
||||||
|
|
||||||
#ifdef CONFIG_PINE64_DT_SELECTION
|
#ifdef CONFIG_PINE64_DT_SELECTION
|
||||||
/* Differentiate the two Pine64 board DTs by their DRAM size. */
|
/* Differentiate the two Pine64 board DTs by their DRAM size. */
|
||||||
if (strstr(name, "-pine64") && strstr(cmp_str, "-pine64")) {
|
if (strstr(name, "-pine64") && strstr(best_dt_name, "-pine64")) {
|
||||||
if ((gd->ram_size > 512 * 1024 * 1024))
|
if ((gd->ram_size > 512 * 1024 * 1024))
|
||||||
return !strstr(name, "plus");
|
return !strstr(name, "plus");
|
||||||
else
|
else
|
||||||
return !!strstr(name, "plus");
|
return !!strstr(name, "plus");
|
||||||
} else {
|
} else {
|
||||||
return strcmp(name, cmp_str);
|
return strcmp(name, best_dt_name);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return strcmp(name, cmp_str);
|
return strcmp(name, best_dt_name);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue