diff options
author | Jakub Kicinski <kuba@kernel.org> | 2021-10-12 16:27:57 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-10-13 19:03:59 +0200 |
commit | 13b5ffa0e282f3d18e57735e37b8fed3a392872b (patch) | |
tree | 52b0862e3d866825464e63775e5bcb65eb732f15 /drivers/net/usb/cdc-phonet.c | |
parent | Merge branch 'net-use-dev_addr_set-in-hamradio-and-ip-tunnels' (diff) | |
download | linux-13b5ffa0e282f3d18e57735e37b8fed3a392872b.tar.xz linux-13b5ffa0e282f3d18e57735e37b8fed3a392872b.zip |
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 <sebastian.reichel@collabora.com> # for HSI
Link: https://lore.kernel.org/r/20211012142757.4124842-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/usb/cdc-phonet.c')
-rw-r--r-- | drivers/net/usb/cdc-phonet.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c index e1da9102a540..ad5121e9cf5d 100644 --- a/drivers/net/usb/cdc-phonet.c +++ b/drivers/net/usb/cdc-phonet.c @@ -275,6 +275,8 @@ static const struct net_device_ops usbpn_ops = { static void usbpn_setup(struct net_device *dev) { + const u8 addr = PN_MEDIA_USB; + dev->features = 0; dev->netdev_ops = &usbpn_ops; dev->header_ops = &phonet_header_ops; @@ -284,8 +286,8 @@ static void usbpn_setup(struct net_device *dev) dev->min_mtu = PHONET_MIN_MTU; dev->max_mtu = PHONET_MAX_MTU; dev->hard_header_len = 1; - dev->dev_addr[0] = PN_MEDIA_USB; dev->addr_len = 1; + dev_addr_set(dev, &addr); dev->tx_queue_len = 3; dev->needs_free_netdev = true; |