Skip to content

Commit b561af3

Browse files
vinodkouldavem330
authored andcommitted
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: Xiaofei Shen <[email protected]> Tested-by: Xiaofei Shen <[email protected]> Signed-off-by: Sneh Shah <[email protected]> Signed-off-by: Vinod Koul <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent acced9d commit b561af3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2616,8 +2616,6 @@ static int stmmac_open(struct net_device *dev)
26162616
u32 chan;
26172617
int ret;
26182618

2619-
stmmac_check_ether_addr(priv);
2620-
26212619
if (priv->hw->pcs != STMMAC_PCS_RGMII &&
26222620
priv->hw->pcs != STMMAC_PCS_TBI &&
26232621
priv->hw->pcs != STMMAC_PCS_RTBI) {
@@ -4303,6 +4301,8 @@ int stmmac_dvr_probe(struct device *device,
43034301
if (ret)
43044302
goto error_hw_init;
43054303

4304+
stmmac_check_ether_addr(priv);
4305+
43064306
/* Configure real RX and TX queues */
43074307
netif_set_real_num_rx_queues(ndev, priv->plat->rx_queues_to_use);
43084308
netif_set_real_num_tx_queues(ndev, priv->plat->tx_queues_to_use);

0 commit comments

Comments
 (0)