From 13b5ffa0e282f3d18e57735e37b8fed3a392872b Mon Sep 17 00:00:00 2001 From: Jakub Kicinski Date: Tue, 12 Oct 2021 07:27:57 -0700 Subject: net: remove single-byte netdev->dev_addr writes Make the drivers which use single-byte netdev addresses (netdev->addr_len == 1) use the appropriate address setting helpers. arcnet copies from int variables and io reads a lot, so add a helper for arcnet drivers to use. Similar helper could be reused for phonet and appletalk but there isn't any good central location where we could put it, and netdevice.h is already very crowded. Acked-by: Sebastian Reichel # for HSI Link: https://lore.kernel.org/r/20211012142757.4124842-1-kuba@kernel.org Signed-off-by: Jakub Kicinski --- drivers/net/arcnet/arc-rimi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/net/arcnet/arc-rimi.c') diff --git a/drivers/net/arcnet/arc-rimi.c b/drivers/net/arcnet/arc-rimi.c index 12d085405bd0..8c3ccc7c83cd 100644 --- a/drivers/net/arcnet/arc-rimi.c +++ b/drivers/net/arcnet/arc-rimi.c @@ -207,7 +207,8 @@ static int __init arcrimi_found(struct net_device *dev) } /* get and check the station ID from offset 1 in shmem */ - dev->dev_addr[0] = arcnet_readb(lp->mem_start, COM9026_REG_R_STATION); + arcnet_set_addr(dev, arcnet_readb(lp->mem_start, + COM9026_REG_R_STATION)); arc_printk(D_NORMAL, dev, "ARCnet RIM I: station %02Xh found at IRQ %d, ShMem %lXh (%ld*%d bytes)\n", dev->dev_addr[0], @@ -324,7 +325,7 @@ static int __init arc_rimi_init(void) return -ENOMEM; if (node && node != 0xff) - dev->dev_addr[0] = node; + arcnet_set_addr(dev, node); dev->mem_start = io; dev->irq = irq; -- cgit 1.4.1