zd1201: use eth_hw_addr_set()
authorJakub Kicinski <kuba@kernel.org>
Mon, 18 Oct 2021 23:50:21 +0000 (16:50 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 20 Oct 2021 09:39:47 +0000 (12:39 +0300)
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: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211018235021.1279697-16-kuba@kernel.org
drivers/net/wireless/zydas/zd1201.c

index 6b735fee7b187b73d873a5c2a9697652ad57353b..e64e4e5795186c89d3e00ca2afd8b8f0bd24c084 100644 (file)
@@ -507,7 +507,7 @@ static int zd1201_getconfig(struct zd1201 *zd, int rid, void *riddata,
  *             byte    data[12]
  *     total: 16
  */
-static int zd1201_setconfig(struct zd1201 *zd, int rid, void *buf, int len, int wait)
+static int zd1201_setconfig(struct zd1201 *zd, int rid, const void *buf, int len, int wait)
 {
        int err;
        unsigned char *request;
@@ -1729,6 +1729,7 @@ static int zd1201_probe(struct usb_interface *interface,
        int err;
        short porttype;
        char buf[IW_ESSID_MAX_SIZE+2];
+       u8 addr[ETH_ALEN];
 
        usb = interface_to_usbdev(interface);
 
@@ -1779,10 +1780,10 @@ static int zd1201_probe(struct usb_interface *interface,
        dev->watchdog_timeo = ZD1201_TX_TIMEOUT;
        strcpy(dev->name, "wlan%d");
 
-       err = zd1201_getconfig(zd, ZD1201_RID_CNFOWNMACADDR, 
-           dev->dev_addr, dev->addr_len);
+       err = zd1201_getconfig(zd, ZD1201_RID_CNFOWNMACADDR, addr, ETH_ALEN);
        if (err)
                goto err_start;
+       eth_hw_addr_set(dev, addr);
 
        /* Set wildcard essid to match zd->essid */
        *(__le16 *)buf = cpu_to_le16(0);