net: wireless: support of_get_mac_address new ERR_PTR error
authorPetr Štetiar <ynezz@true.cz>
Fri, 3 May 2019 14:27:12 +0000 (16:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 May 2019 04:47:07 +0000 (21:47 -0700)
There was NVMEM support added to of_get_mac_address, so it could now return
ERR_PTR encoded error values, so we need to adjust all current users of
of_get_mac_address to this new fact.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wireless/ath/ath9k/init.c
drivers/net/wireless/mediatek/mt76/eeprom.c
drivers/net/wireless/ralink/rt2x00/rt2x00dev.c

index 98141b699c883cf327ca477cc087ae71297dbb27..a04d8616fe09f8ea26bea20513e9e80eaf374c1a 100644 (file)
@@ -642,7 +642,7 @@ static int ath9k_of_init(struct ath_softc *sc)
        }
 
        mac = of_get_mac_address(np);
-       if (mac)
+       if (!IS_ERR(mac))
                ether_addr_copy(common->macaddr, mac);
 
        return 0;
index a1529920d8776350a26c61a8256bb570a1784cc5..04964937a3af24c544b969c3791dd64f44e3d62e 100644 (file)
@@ -94,7 +94,7 @@ mt76_eeprom_override(struct mt76_dev *dev)
                return;
 
        mac = of_get_mac_address(np);
-       if (mac)
+       if (!IS_ERR(mac))
                memcpy(dev->macaddr, mac, ETH_ALEN);
 #endif
 
index bdc55d649a885f4b6603a3ad086e4d61242d94e3..1b08b01db27bc519dc7afc7d9c9efb646b490a3a 100644 (file)
@@ -1007,7 +1007,7 @@ void rt2x00lib_set_mac_address(struct rt2x00_dev *rt2x00dev, u8 *eeprom_mac_addr
        const char *mac_addr;
 
        mac_addr = of_get_mac_address(rt2x00dev->dev->of_node);
-       if (mac_addr)
+       if (!IS_ERR(mac_addr))
                ether_addr_copy(eeprom_mac_addr, mac_addr);
 
        if (!is_valid_ether_addr(eeprom_mac_addr)) {