diff mbox

[U-Boot,RESEND,v3,3/5] net: avoid eth_unregister() call when function is unavailable

Message ID 1442237387-29474-4-git-send-email-bernhard.nortmann@web.de
State Accepted
Delegated to: Joe Hershberger
Headers show

Commit Message

Bernhard Nortmann Sept. 14, 2015, 1:29 p.m. UTC
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 <bernhard.nortmann@web.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
---

Changes in v3: None
Changes in v2:
- add "net:" prefix to commit message

 common/bootm.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Joe Hershberger Sept. 30, 2015, 5:22 p.m. UTC | #1
On Mon, Sep 14, 2015 at 8:29 AM, Bernhard Nortmann
<bernhard.nortmann@web.de> wrote:
> 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 <bernhard.nortmann@web.de>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Acked-by: Joe Hershberger <joe.hershberger@ni.com>

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

Patch

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)