提交 b02f8aa8 编写于 作者: V Vinod Koul 提交者: Greg Kroah-Hartman

net: stmmac: move stmmac_check_ether_addr() to driver probe

[ Upstream commit b561af36b1841088552464cdc3f6371d92f17710 ]

stmmac_check_ether_addr() checks the MAC address and assigns one in
driver open(). In many cases when we create slave netdevice, the dev
addr is inherited from master but the master dev addr maybe NULL at
that time, so move this call to driver probe so that address is
always valid.
Signed-off-by: NXiaofei Shen <xiaofeis@codeaurora.org>
Tested-by: NXiaofei Shen <xiaofeis@codeaurora.org>
Signed-off-by: NSneh Shah <snehshah@codeaurora.org>
Signed-off-by: NVinod Koul <vkoul@kernel.org>
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 d7b10dfe
...@@ -2595,8 +2595,6 @@ static int stmmac_open(struct net_device *dev) ...@@ -2595,8 +2595,6 @@ static int stmmac_open(struct net_device *dev)
u32 chan; u32 chan;
int ret; int ret;
stmmac_check_ether_addr(priv);
if (priv->hw->pcs != STMMAC_PCS_RGMII && if (priv->hw->pcs != STMMAC_PCS_RGMII &&
priv->hw->pcs != STMMAC_PCS_TBI && priv->hw->pcs != STMMAC_PCS_TBI &&
priv->hw->pcs != STMMAC_PCS_RTBI) { priv->hw->pcs != STMMAC_PCS_RTBI) {
...@@ -4296,6 +4294,8 @@ int stmmac_dvr_probe(struct device *device, ...@@ -4296,6 +4294,8 @@ int stmmac_dvr_probe(struct device *device,
if (ret) if (ret)
goto error_hw_init; goto error_hw_init;
stmmac_check_ether_addr(priv);
/* Configure real RX and TX queues */ /* Configure real RX and TX queues */
netif_set_real_num_rx_queues(ndev, priv->plat->rx_queues_to_use); netif_set_real_num_rx_queues(ndev, priv->plat->rx_queues_to_use);
netif_set_real_num_tx_queues(ndev, priv->plat->tx_queues_to_use); netif_set_real_num_tx_queues(ndev, priv->plat->tx_queues_to_use);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册