Skip to content

Commit a2e39c1

Browse files
ynezzcristibirsan
authored andcommitted
net: wireless: support of_get_mac_address new ERR_PTR error
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> Signed-off-by: Marcelo Roberto Jimenez <marcelo.jimenez@gmail.com>
1 parent 09c33e0 commit a2e39c1

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

drivers/net/wireless/ath/ath9k/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ static int ath9k_of_init(struct ath_softc *sc)
639639
}
640640

641641
mac = of_get_mac_address(np);
642-
if (mac)
642+
if (!IS_ERR(mac))
643643
ether_addr_copy(common->macaddr, mac);
644644

645645
ah->ah_flags &= ~AH_USE_EEPROM;

drivers/net/wireless/mediatek/mt76/eeprom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ mt76_eeprom_override(struct mt76_dev *dev)
8686
return;
8787

8888
mac = of_get_mac_address(np);
89-
if (mac)
89+
if (!IS_ERR(mac))
9090
memcpy(dev->macaddr, mac, ETH_ALEN);
9191
#endif
9292

drivers/net/wireless/ralink/rt2x00/rt2x00dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ void rt2x00lib_set_mac_address(struct rt2x00_dev *rt2x00dev, u8 *eeprom_mac_addr
10071007
const char *mac_addr;
10081008

10091009
mac_addr = of_get_mac_address(rt2x00dev->dev->of_node);
1010-
if (mac_addr)
1010+
if (!IS_ERR(mac_addr))
10111011
ether_addr_copy(eeprom_mac_addr, mac_addr);
10121012

10131013
if (!is_valid_ether_addr(eeprom_mac_addr)) {

0 commit comments

Comments
 (0)