From 27ee59af28d0a6d0430947ad3cdda6ef0e7b1189 Mon Sep 17 00:00:00 2001 From: Alexey Brodkin Date: Fri, 10 Jan 2014 19:58:11 +0400 Subject: [PATCH] net: execute "miiphy_init" if CONFIG_PHYLIB defined 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 Cc: Simon Glass Cc: Wolfgang Denk Acked-by: Joe Hershberger Signed-off-by: Alexey Brodkin --- net/eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/eth.c b/net/eth.c index c96e767e8e..32bd10c829 100644 --- 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 -- 2.25.1