Commit a9b2da9b85b2678ef9989a9f397b8fc37545f4c5

Authored by Peng Fan
Committed by Ye Li
1 parent 4266aac456

net: fec: set dev->seq to priv->dev_id

To platforms has two enet interface, using dev->seq could
avoid conflict.

i.MX6UL/ULL evk board net get the wrong MAC address from fuse,
eth1 get MAC0 address, eth0 get MAC1 address from fuse. Set the
priv->dev_id to device->seq as the real net interface alias id then
.fec_get_hwaddr() read the related MAC address from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

Showing 1 changed file with 2 additions and 3 deletions Side-by-side Diff

drivers/net/fec_mxc.c
... ... @@ -1250,7 +1250,6 @@
1250 1250 struct eth_pdata *pdata = dev_get_platdata(dev);
1251 1251 struct fec_priv *priv = dev_get_priv(dev);
1252 1252 struct mii_dev *bus = NULL;
1253   - int dev_id = -1;
1254 1253 uint32_t start;
1255 1254 int ret;
1256 1255  
1257 1256  
... ... @@ -1271,9 +1270,9 @@
1271 1270 }
1272 1271  
1273 1272 fec_reg_setup(priv);
1274   - priv->dev_id = (dev_id == -1) ? 0 : dev_id;
1275 1273  
1276   - bus = fec_get_miibus((ulong)priv->eth, dev_id);
  1274 + priv->dev_id = dev->seq;
  1275 + bus = fec_get_miibus((ulong)priv->eth, dev->seq);
1277 1276 if (!bus) {
1278 1277 ret = -ENOMEM;
1279 1278 goto err_mii;