net: ethernet: stmicro: stmmac: Get the ethernet mac address at stmmac_open

When it is the initialized probe, getting or setting the Ethernet address
from the vendor partition will fail. The function for reading/writting
vendor partition is not registered and changed this to stmmac_open to
ensure the operation worked.

Change-Id: Id9401e7ffcbc16a266ecb69b3777499919c50ed6
Signed-off-by: David Wu <david.wu@rock-chips.com>
This commit is contained in:
David Wu
2019-11-27 17:03:24 +08:00
committed by Tao Huang
parent 0bacdd1bd8
commit ea92092755

View File

@@ -2633,6 +2633,8 @@ static int stmmac_open(struct net_device *dev)
goto init_error;
}
stmmac_check_ether_addr(priv);
ret = stmmac_hw_setup(dev, true);
if (ret < 0) {
netdev_err(priv->dev, "%s: Hw setup failed\n", __func__);
@@ -4319,8 +4321,6 @@ 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);