summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/davicom
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-10-15 23:53:04 +0200
committerDavid S. Miller <davem@davemloft.net>2021-10-18 14:20:38 +0200
commit4abd7cffc09a38015fa14a22471e3de48a4ca032 (patch)
treeb6a0100f08a5de51263210934a6ce8f4fec1f4f0 /drivers/net/ethernet/davicom
parentocteontx2-nic: fix mixed module build (diff)
downloadlinux-4abd7cffc09a38015fa14a22471e3de48a4ca032.tar.xz
linux-4abd7cffc09a38015fa14a22471e3de48a4ca032.zip
ethernet: use eth_hw_addr_set() in unmaintained drivers
Commit 406f42fa0d3c ("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: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/davicom')
-rw-r--r--drivers/net/ethernet/davicom/dm9000.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
index e13dd53a8b3b..0985ab216566 100644
--- a/drivers/net/ethernet/davicom/dm9000.c
+++ b/drivers/net/ethernet/davicom/dm9000.c
@@ -1425,6 +1425,7 @@ dm9000_probe(struct platform_device *pdev)
enum of_gpio_flags flags;
struct regulator *power;
bool inv_mac_addr = false;
+ u8 addr[ETH_ALEN];
power = devm_regulator_get(dev, "vcc");
if (IS_ERR(power)) {
@@ -1666,7 +1667,8 @@ dm9000_probe(struct platform_device *pdev)
/* try reading the node address from the attached EEPROM */
for (i = 0; i < 6; i += 2)
- dm9000_read_eeprom(db, i / 2, ndev->dev_addr+i);
+ dm9000_read_eeprom(db, i / 2, addr + i);
+ eth_hw_addr_set(ndev, addr);
if (!is_valid_ether_addr(ndev->dev_addr) && pdata != NULL) {
mac_src = "platform data";
@@ -1678,7 +1680,8 @@ dm9000_probe(struct platform_device *pdev)
mac_src = "chip";
for (i = 0; i < 6; i++)
- ndev->dev_addr[i] = ior(db, i+DM9000_PAR);
+ addr[i] = ior(db, i + DM9000_PAR);
+ eth_hw_addr_set(ndev, pdata->dev_addr);
}
if (!is_valid_ether_addr(ndev->dev_addr)) {