Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b561af36 authored by Vinod Koul's avatar Vinod Koul Committed by David S. Miller
Browse files

net: stmmac: move stmmac_check_ether_addr() to driver probe



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: default avatarXiaofei Shen <xiaofeis@codeaurora.org>
Tested-by: default avatarXiaofei Shen <xiaofeis@codeaurora.org>
Signed-off-by: default avatarSneh Shah <snehshah@codeaurora.org>
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent acced9d2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2616,8 +2616,6 @@ static int stmmac_open(struct net_device *dev)
	u32 chan;
	int ret;

	stmmac_check_ether_addr(priv);

	if (priv->hw->pcs != STMMAC_PCS_RGMII &&
	    priv->hw->pcs != STMMAC_PCS_TBI &&
	    priv->hw->pcs != STMMAC_PCS_RTBI) {
@@ -4303,6 +4301,8 @@ int stmmac_dvr_probe(struct device *device,
	if (ret)
		goto error_hw_init;

	stmmac_check_ether_addr(priv);

	/* Configure real RX and TX queues */
	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);