提交 13898e93 编写于 作者: J Jakub Kicinski 提交者: Greg Kroah-Hartman

staging: unisys: 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.
Signed-off-by: NJakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20211019171243.1412240-7-kuba@kernel.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 d0cf28f1
...@@ -1782,6 +1782,7 @@ static int visornic_probe(struct visor_device *dev) ...@@ -1782,6 +1782,7 @@ static int visornic_probe(struct visor_device *dev)
struct net_device *netdev = NULL; struct net_device *netdev = NULL;
int err; int err;
int channel_offset = 0; int channel_offset = 0;
u8 addr[ETH_ALEN];
u64 features; u64 features;
netdev = alloc_etherdev(sizeof(struct visornic_devdata)); netdev = alloc_etherdev(sizeof(struct visornic_devdata));
...@@ -1798,14 +1799,14 @@ static int visornic_probe(struct visor_device *dev) ...@@ -1798,14 +1799,14 @@ static int visornic_probe(struct visor_device *dev)
/* Get MAC address from channel and read it into the device. */ /* Get MAC address from channel and read it into the device. */
netdev->addr_len = ETH_ALEN; netdev->addr_len = ETH_ALEN;
channel_offset = offsetof(struct visor_io_channel, vnic.macaddr); channel_offset = offsetof(struct visor_io_channel, vnic.macaddr);
err = visorbus_read_channel(dev, channel_offset, netdev->dev_addr, err = visorbus_read_channel(dev, channel_offset, addr, ETH_ALEN);
ETH_ALEN);
if (err < 0) { if (err < 0) {
dev_err(&dev->device, dev_err(&dev->device,
"%s failed to get mac addr from chan (%d)\n", "%s failed to get mac addr from chan (%d)\n",
__func__, err); __func__, err);
goto cleanup_netdev; goto cleanup_netdev;
} }
eth_hw_addr_set(netdev, addr);
devdata = devdata_initialize(netdev_priv(netdev), dev); devdata = devdata_initialize(netdev_priv(netdev), dev);
if (!devdata) { if (!devdata) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册