]> git.sur5r.net Git - u-boot/commitdiff
net: execute "miiphy_init" if CONFIG_PHYLIB defined
authorAlexey Brodkin <Alexey.Brodkin@synopsys.com>
Fri, 10 Jan 2014 15:58:11 +0000 (19:58 +0400)
committerTom Rini <trini@ti.com>
Fri, 7 Feb 2014 14:16:36 +0000 (09:16 -0500)
In "common/Makefile" "miiphyutil.o" gets built if any of the following
items enabled:
 * CONFIG_PHYLIB
 * CONFIG_MII
 * CONFIG_CMD_MII

So it's possible to not define CONFIG_MII or CONFIG_CMD_MII and still
use functions like "miiphy_get_dev_by_name".

In its turn "miiphy_get_dev_by_name" traverses "mii_devs" list which is
not initialized because "miiphy_init" never got called.

Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Wolfgang Denk <wd@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
net/eth.c

index c96e767e8e22b8beef592deaee91cca983ef64e6..32bd10c8290a6e2af662b566d8d64405a2c5efe1 100644 (file)
--- a/net/eth.c
+++ b/net/eth.c
@@ -279,7 +279,7 @@ int eth_initialize(bd_t *bis)
        eth_current = NULL;
 
        bootstage_mark(BOOTSTAGE_ID_NET_ETH_START);
-#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) || defined(CONFIG_PHYLIB)
        miiphy_init();
 #endif