Commit 0d4c7517 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

ethernet: aeroflex: use eth_hw_addr_set()

Commit 406f42fa ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

macaddr[] is a module param, and int, so copy the address into
an array of u8 on the stack, then call eth_hw_addr_set().
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8ec53ed9
...@@ -1346,6 +1346,7 @@ static int greth_of_probe(struct platform_device *ofdev) ...@@ -1346,6 +1346,7 @@ static int greth_of_probe(struct platform_device *ofdev)
int i; int i;
int err; int err;
int tmp; int tmp;
u8 addr[ETH_ALEN];
unsigned long timeout; unsigned long timeout;
dev = alloc_etherdev(sizeof(struct greth_private)); dev = alloc_etherdev(sizeof(struct greth_private));
...@@ -1449,8 +1450,6 @@ static int greth_of_probe(struct platform_device *ofdev) ...@@ -1449,8 +1450,6 @@ static int greth_of_probe(struct platform_device *ofdev)
break; break;
} }
if (i == 6) { if (i == 6) {
u8 addr[ETH_ALEN];
err = of_get_mac_address(ofdev->dev.of_node, addr); err = of_get_mac_address(ofdev->dev.of_node, addr);
if (!err) { if (!err) {
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
...@@ -1464,7 +1463,8 @@ static int greth_of_probe(struct platform_device *ofdev) ...@@ -1464,7 +1463,8 @@ static int greth_of_probe(struct platform_device *ofdev)
} }
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
dev->dev_addr[i] = macaddr[i]; addr[i] = macaddr[i];
eth_hw_addr_set(dev, addr);
macaddr[5]++; macaddr[5]++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment