From: Bernhard Nortmann Date: Sat, 22 Aug 2015 00:30:47 +0200 Subject: [U-Boot] [RFC PATCH 3/3] avoid eth_unregister() call when function is unavailable In-Reply-To: <1440196247-6885-1-git-send-email-bernhard.nortmann@web.de> References: <1440196247-6885-1-git-send-email-bernhard.nortmann@web.de> Message-ID: <1440196247-6885-4-git-send-email-bernhard.nortmann@web.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de CONFIG_NETCONSOLE causes common/bootm.c to call eth_unregister() for network device shutdown. However, with CONFIG_DM_ETH this function is no longer defined. This is a workaround to avoid the call in that case, and solely rely on eth_halt(). In case this is insufficient, a proper way to unregister / remove network devices needs to be implemented. Signed-off-by: Bernhard Nortmann --- common/bootm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/bootm.c b/common/bootm.c index 667c934..c0d0d09 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -474,7 +474,9 @@ ulong bootm_disable_interrupts(void) #ifdef CONFIG_NETCONSOLE /* Stop the ethernet stack if NetConsole could have left it up */ eth_halt(); +# ifndef CONFIG_DM_ETH eth_unregister(eth_get_dev()); +# endif #endif #if defined(CONFIG_CMD_USB) -- 2.4.6