diff mbox series

[v4,13/18] common: board_r: Drop initr_jumptable wrapper

Message ID 20201128084320.10164-14-ovidiu.panait@windriver.com
State Accepted
Delegated to: Tom Rini
Headers show
Series Minor board_f/board_r cleanups | expand

Commit Message

Ovidiu Panait Nov. 28, 2020, 8:43 a.m. UTC
Add a return value to jumptable_init and use it directly in the
post-relocation init sequence, rather than using a wrapper stub.

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
v4 updates:
- none

v3 updates:
- add reviewed-by tag

v2 updates:
- add function comment

 common/board_r.c  |  8 +-------
 common/exports.c  |  4 +++-
 include/exports.h | 10 ++++++++--
 3 files changed, 12 insertions(+), 10 deletions(-)

Comments

Tom Rini Jan. 16, 2021, 4:23 p.m. UTC | #1
On Sat, Nov 28, 2020 at 10:43:15AM +0200, Ovidiu Panait wrote:

> Add a return value to jumptable_init and use it directly in the
> post-relocation init sequence, rather than using a wrapper stub.
> 
> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/common/board_r.c b/common/board_r.c
index a5cbbcc343..32ad40d372 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -490,12 +490,6 @@  static int initr_malloc_bootparams(void)
 }
 #endif
 
-static int initr_jumptable(void)
-{
-	jumptable_init();
-	return 0;
-}
-
 #if defined(CONFIG_API)
 static int initr_api(void)
 {
@@ -757,7 +751,7 @@  static init_fnc_t init_sequence_r[] = {
 	pci_init,
 #endif
 	stdio_add_devices,
-	initr_jumptable,
+	jumptable_init,
 #ifdef CONFIG_API
 	initr_api,
 #endif
diff --git a/common/exports.c b/common/exports.c
index 6253b55694..4578f07021 100644
--- a/common/exports.c
+++ b/common/exports.c
@@ -25,8 +25,10 @@  unsigned long get_version(void)
 # define miiphy_set_current_dev		dummy
 #endif
 
-void jumptable_init(void)
+int jumptable_init(void)
 {
 	gd->jt = malloc(sizeof(struct jt_funcs));
 #include <_exports.h>
+
+	return 0;
 }
diff --git a/include/exports.h b/include/exports.h
index b300554091..faf0f59244 100644
--- a/include/exports.h
+++ b/include/exports.h
@@ -15,8 +15,14 @@ 
 struct cmd_tbl;
 struct spi_slave;
 
-/* Set up the jump table for use by the API */
-void jumptable_init(void);
+/**
+ * jumptable_init() - Set up the jump table for use by the API
+ *
+ * It is called during the generic post-relocation init sequence.
+ *
+ * Return: 0 if OK
+ */
+int jumptable_init(void);
 
 /* These are declarations of exported functions available in C code */
 unsigned long get_version(void);