summaryrefslogtreecommitdiff
path: root/arch/arm/mach-uniphier/spl_board_init.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-01-21 18:05:27 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2017-01-22 16:49:33 +0900
commitee8ef5afa87bf37d493bf7be9d475e54d6c2ebee (patch)
tree26698081909c04e0f0c3f1d1a664d83e60ec0884 /arch/arm/mach-uniphier/spl_board_init.c
parente27d6c7d328caf75bd7680109bc6610bc681f46e (diff)
ARM: uniphier: add macro to generate SoC data look-up function
There are similar functions that look up SoC data by the SoC ID. The new macro UNIPHIER_DEFINE_SOCDATA_FUNC will be helpful to avoid the code duplication. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'arch/arm/mach-uniphier/spl_board_init.c')
-rw-r--r--arch/arm/mach-uniphier/spl_board_init.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/arch/arm/mach-uniphier/spl_board_init.c b/arch/arm/mach-uniphier/spl_board_init.c
index 83851ef7d6..da749a3d6d 100644
--- a/arch/arm/mach-uniphier/spl_board_init.c
+++ b/arch/arm/mach-uniphier/spl_board_init.c
@@ -118,25 +118,12 @@ static const struct uniphier_spl_initdata uniphier_spl_initdata[] = {
},
#endif
};
-
-static const struct uniphier_spl_initdata *uniphier_get_spl_initdata(
- unsigned int soc_id)
-{
- int i;
-
- for (i = 0; i < ARRAY_SIZE(uniphier_spl_initdata); i++) {
- if (uniphier_spl_initdata[i].soc_id == soc_id)
- return &uniphier_spl_initdata[i];
- }
-
- return NULL;
-}
+UNIPHIER_DEFINE_SOCDATA_FUNC(uniphier_get_spl_initdata, uniphier_spl_initdata)
void spl_board_init(void)
{
const struct uniphier_board_data *bd;
const struct uniphier_spl_initdata *initdata;
- unsigned int soc_id;
int ret;
#ifdef CONFIG_DEBUG_UART
@@ -147,8 +134,7 @@ void spl_board_init(void)
if (!bd)
hang();
- soc_id = uniphier_get_soc_id();
- initdata = uniphier_get_spl_initdata(soc_id);
+ initdata = uniphier_get_spl_initdata();
if (!initdata)
hang();