aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-07-10 20:07:47 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-07-10 22:42:07 +0900
commit72cd83ab81969b970247c6c74e710cdce2c2bdae (patch)
treee5b9ed09c875b34b4fcc9e84a4914a1243b746e5 /arch
parent1f8357c3ab27685fa32693ed9cba793932407a69 (diff)
downloadu-boot-72cd83ab81969b970247c6c74e710cdce2c2bdae.zip
u-boot-72cd83ab81969b970247c6c74e710cdce2c2bdae.tar.gz
u-boot-72cd83ab81969b970247c6c74e710cdce2c2bdae.tar.bz2
ARM: uniphier: turn uniphier_set_fdt_file() into void function
For consistency with a function that will be added. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-uniphier/board_late_init.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/arch/arm/mach-uniphier/board_late_init.c b/arch/arm/mach-uniphier/board_late_init.c
index 86b128a..37b375c 100644
--- a/arch/arm/mach-uniphier/board_late_init.c
+++ b/arch/arm/mach-uniphier/board_late_init.c
@@ -31,24 +31,25 @@ static void nand_denali_wp_disable(void)
#endif
}
-static int uniphier_set_fdt_file(void)
+static void uniphier_set_env_fdt_file(void)
{
DECLARE_GLOBAL_DATA_PTR;
const char *compat;
char dtb_name[256];
int buf_len = sizeof(dtb_name);
+ int ret;
if (env_get("fdtfile"))
- return 0; /* do nothing if it is already set */
+ return; /* do nothing if it is already set */
compat = fdt_stringlist_get(gd->fdt_blob, 0, "compatible", 0, NULL);
if (!compat)
- return -EINVAL;
+ goto fail;
/* rip off the vendor prefix "socionext," */
compat = strchr(compat, ',');
if (!compat)
- return -EINVAL;
+ goto fail;
compat++;
strncpy(dtb_name, compat, buf_len);
@@ -56,7 +57,13 @@ static int uniphier_set_fdt_file(void)
strncat(dtb_name, ".dtb", buf_len);
- return env_set("fdtfile", dtb_name);
+ ret = env_set("fdtfile", dtb_name);
+ if (ret)
+ goto fail;
+
+ return;
+fail:
+ pr_warn("\"fdt_file\" environment variable was not set correctly\n");
}
int board_late_init(void)
@@ -96,8 +103,7 @@ int board_late_init(void)
printf("\n");
- if (uniphier_set_fdt_file())
- pr_warn("fdt_file environment was not set correctly\n");
+ uniphier_set_env_fdt_file();
return 0;
}