Skip to contentSkip to conversation

davinci_emac: fixed setting MAC at init time

PATCH In review Bas van den Berg 2 participants 2 messages Mar 1, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 davinci_emac: fixed setting MAC at init time

Without this patch, the MAC number will show up as zero's until the interface is brought up for the first time. (eg. with ifconfig -a)

---
 drivers/net/ethernet/ti/davinci_emac.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/ethernet/ti/davinci_emac.c +1 -0
index 4b2f545..11b169a 100644
@@ -1904,6 +1904,7 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
 		dev_warn(&pdev->dev, "using random MAC addr: %pM\n",
 							priv->mac_addr);
 	}
+	memcpy(ndev->dev_addr, priv->mac_addr, ndev->addr_len);
 
 	ndev->netdev_ops = &emac_netdev_ops;
 	SET_ETHTOOL_OPS(ndev, &ethtool_ops);
Signature · 1 line
1.7.0.4
maintainer
#1 lore raw

From: Bas van den Berg <[email protected]>
Date: Thu, 1 Mar 2012 09:42:42 +0100

Quoted 4 lines

Without this patch, the MAC number will show up as zero's until the interface is brought up for the first time. (eg. with ifconfig -a)

Well then the copy (which is also unnecessarily by hand using a loop instead of a memcpy call) in emac_dev_open() is redundant and should be removed when you make this change.