All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ovidiu Panait <ovidiu.panait@windriver.com>
To: u-boot@lists.denx.de
Subject: [PATCH v4 09/18] common: board_r: Drop initr_pci_ep wrapper
Date: Sat, 28 Nov 2020 10:43:11 +0200	[thread overview]
Message-ID: <20201128084320.10164-10-ovidiu.panait@windriver.com> (raw)
In-Reply-To: <20201128084320.10164-1-ovidiu.panait@windriver.com>

Add a return value to pci_ep_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                     | 11 +----------
 drivers/pci_endpoint/pci_ep-uclass.c |  4 +++-
 include/init.h                       | 10 +++++++++-
 3 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/common/board_r.c b/common/board_r.c
index 7a06627ba9..d86ff0cb5e 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -214,15 +214,6 @@ static int initr_unlock_ram_in_cache(void)
 }
 #endif
 
-#ifdef CONFIG_PCI_ENDPOINT
-static int initr_pci_ep(void)
-{
-	pci_ep_init();
-
-	return 0;
-}
-#endif
-
 #ifdef CONFIG_PCI
 static int initr_pci(void)
 {
@@ -836,7 +827,7 @@ static init_fnc_t init_sequence_r[] = {
 	initr_bbmii,
 #endif
 #ifdef CONFIG_PCI_ENDPOINT
-	initr_pci_ep,
+	pci_ep_init,
 #endif
 #ifdef CONFIG_CMD_NET
 	INIT_FUNC_WATCHDOG_RESET
diff --git a/drivers/pci_endpoint/pci_ep-uclass.c b/drivers/pci_endpoint/pci_ep-uclass.c
index 38a5f08376..aa89701de8 100644
--- a/drivers/pci_endpoint/pci_ep-uclass.c
+++ b/drivers/pci_endpoint/pci_ep-uclass.c
@@ -210,7 +210,7 @@ UCLASS_DRIVER(pci_ep) = {
 	.flags		= DM_UC_FLAG_SEQ_ALIAS,
 };
 
-void pci_ep_init(void)
+int pci_ep_init(void)
 {
 	struct udevice *dev;
 
@@ -219,4 +219,6 @@ void pci_ep_init(void)
 	     uclass_next_device_check(&dev)) {
 		;
 	}
+
+	return 0;
 }
diff --git a/include/init.h b/include/init.h
index 7cdc47cff1..c6c5f34b55 100644
--- a/include/init.h
+++ b/include/init.h
@@ -177,6 +177,15 @@ int setup_bdinfo(void);
  */
 int cpu_secondary_init_r(void);
 
+/**
+ * pci_ep_init() - Initialize pci endpoint devices
+ *
+ * It is called during the generic post-relocation init sequence.
+ *
+ * Return: 0 if OK
+ */
+int pci_ep_init(void);
+
 /**
  * init_cache_f_r() - Turn on the cache in preparation for relocation
  *
@@ -249,7 +258,6 @@ int set_cpu_clk_info(void);
 int update_flash_size(int flash_size);
 int arch_early_init_r(void);
 void pci_init(void);
-void pci_ep_init(void);
 int misc_init_r(void);
 #if defined(CONFIG_VID)
 int init_func_vid(void);
-- 
2.17.1

  parent reply	other threads:[~2020-11-28  8:43 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-28  8:43 [PATCH v4 00/18] Minor board_f/board_r cleanups Ovidiu Panait
2020-11-28  8:43 ` [PATCH v4 01/18] common: Kconfig: Introduce CONFIG_CONSOLE_RECORD_INIT_F Ovidiu Panait
2021-01-16 16:22   ` Tom Rini
2020-11-28  8:43 ` [PATCH v4 02/18] common: board_f: Drop initf_console_record wrapper Ovidiu Panait
2021-01-16 16:22   ` Tom Rini
2020-11-28  8:43 ` [PATCH v4 03/18] common: board_f: Use IS_ENABLED(CONFIG_TIMER_EARLY) in initf_dm Ovidiu Panait
2021-01-16 16:22   ` Tom Rini
2021-01-16 16:22   ` Tom Rini
2020-11-28  8:43 ` [PATCH v4 04/18] common: board_f: Move setup_machine code to setup_bdinfo Ovidiu Panait
2021-01-16 16:22   ` Tom Rini
2020-11-28  8:43 ` [PATCH v4 05/18] common: board_f: Use IS_ENABLED(CONFIG_OF_EMBED) in reserve_fdt, reloc_fdt Ovidiu Panait
2021-01-16 16:22   ` Tom Rini
2020-11-28  8:43 ` [PATCH v4 06/18] common: board_r: Drop initr_console_record wrapper Ovidiu Panait
2021-01-16 16:22   ` Tom Rini
2020-11-28  8:43 ` [PATCH v4 07/18] common: board_r: Drop initr_secondary_cpu wrapper Ovidiu Panait
2020-11-30 20:12   ` Simon Glass
2021-01-16 16:22   ` Tom Rini
2020-11-28  8:43 ` [PATCH v4 08/18] common: board_r: Drop initr_post_backlog wrapper Ovidiu Panait
2021-01-16 16:23   ` Tom Rini
2020-11-28  8:43 ` Ovidiu Panait [this message]
2021-01-16 16:23   ` [PATCH v4 09/18] common: board_r: Drop initr_pci_ep wrapper Tom Rini
2020-11-28  8:43 ` [PATCH v4 10/18] common: board_r: Drop initr_pci wrapper Ovidiu Panait
2021-01-16 16:23   ` Tom Rini
2020-11-28  8:43 ` [PATCH v4 11/18] common: board_r: Drop initr_noncached wrapper Ovidiu Panait
2021-01-16 16:23   ` Tom Rini
2020-11-28  8:43 ` [PATCH v4 12/18] common: board_r: Drop initr_xen wrapper Ovidiu Panait
2021-01-16 16:23   ` Tom Rini
2020-11-28  8:43 ` [PATCH v4 13/18] common: board_r: Drop initr_jumptable wrapper Ovidiu Panait
2021-01-16 16:23   ` Tom Rini
2020-11-28  8:43 ` [PATCH v4 14/18] common: board_r: Drop initr_api wrapper Ovidiu Panait
2021-01-16 16:23   ` Tom Rini
2020-11-28  8:43 ` [PATCH v4 15/18] common: board_r: Drop initr_bbmii wrapper Ovidiu Panait
2021-01-16 16:23   ` Tom Rini
2020-11-28  8:43 ` [PATCH v4 16/18] common: board_r: Drop arch-specific ifdefs around initr_trap Ovidiu Panait
2020-11-30 18:24   ` Daniel Schwierzeck
2021-01-16 16:23   ` Tom Rini
2020-11-28  8:43 ` [PATCH v4 17/18] spl: Kconfig: Add SPL dependency to CONFIG_HANDOFF Ovidiu Panait
2021-01-16 16:24   ` Tom Rini
2020-11-28  8:43 ` [PATCH v4 18/18] global_data: Enable spl_handoff only if CONFIG_HANDOFF is set Ovidiu Panait
2021-01-16 16:24   ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201128084320.10164-10-ovidiu.panait@windriver.com \
    --to=ovidiu.panait@windriver.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.