diff mbox series

[net,v2,5/6] ethernet: 8390/etherh: don't write directly to netdev->dev_addr

Message ID 20220126003801.1736586-6-kuba@kernel.org (mailing list archive)
State New, archived
Headers show
Series ethernet: fix some esoteric drivers after netdev->dev_addr constification | expand

Commit Message

Jakub Kicinski Jan. 26, 2022, 12:38 a.m. UTC
netdev->dev_addr is const now.

Compile tested rpc_defconfig w/ GCC 8.5.

Fixes: adeef3e32146 ("net: constify netdev->dev_addr")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 drivers/net/ethernet/8390/etherh.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Russell King (Oracle) Jan. 26, 2022, 11:01 a.m. UTC | #1
On Tue, Jan 25, 2022 at 04:38:00PM -0800, Jakub Kicinski wrote:
> netdev->dev_addr is const now.
> 
> Compile tested rpc_defconfig w/ GCC 8.5.
> 
> Fixes: adeef3e32146 ("net: constify netdev->dev_addr")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Thanks!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/8390/etherh.c b/drivers/net/ethernet/8390/etherh.c
index bd22a534b1c0..e7b879123bb1 100644
--- a/drivers/net/ethernet/8390/etherh.c
+++ b/drivers/net/ethernet/8390/etherh.c
@@ -655,6 +655,7 @@  etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
 	struct ei_device *ei_local;
 	struct net_device *dev;
 	struct etherh_priv *eh;
+	u8 addr[ETH_ALEN];
 	int ret;
 
 	ret = ecard_request_resources(ec);
@@ -724,12 +725,13 @@  etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
 	spin_lock_init(&ei_local->page_lock);
 
 	if (ec->cid.product == PROD_ANT_ETHERM) {
-		etherm_addr(dev->dev_addr);
+		etherm_addr(addr);
 		ei_local->reg_offset = etherm_regoffsets;
 	} else {
-		etherh_addr(dev->dev_addr, ec);
+		etherh_addr(addr, ec);
 		ei_local->reg_offset = etherh_regoffsets;
 	}
+	eth_hw_addr_set(dev, addr);
 
 	ei_local->name          = dev->name;
 	ei_local->word16        = 1;