diff mbox series

[v4,07/10] net: wireless: support of_get_mac_address new ERR_PTR error

Message ID 1556893635-18549-8-git-send-email-ynezz@true.cz (mailing list archive)
State New, archived
Headers show
Series of_net: Add NVMEM support to of_get_mac_address | expand

Commit Message

Petr Štetiar May 3, 2019, 2:27 p.m. UTC
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>
---

 Changes since v3:

  * IS_ERR_OR_NULL -> IS_ERR

 drivers/net/wireless/ath/ath9k/init.c          | 2 +-
 drivers/net/wireless/mediatek/mt76/eeprom.c    | 2 +-
 drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Comments

Kalle Valo May 6, 2019, 7:59 a.m. UTC | #1
Petr Štetiar <ynezz@true.cz> writes:

> 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>
> ---
>
>  Changes since v3:
>
>   * IS_ERR_OR_NULL -> IS_ERR
>
>  drivers/net/wireless/ath/ath9k/init.c          | 2 +-
>  drivers/net/wireless/mediatek/mt76/eeprom.c    | 2 +-
>  drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)

Via which tree is this supposed to go? In case something else than my
wireless-drivers-next:

Acked-by: Kalle Valo <kvalo@codeaurora.org>
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 98141b6..a04d861 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -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;
diff --git a/drivers/net/wireless/mediatek/mt76/eeprom.c b/drivers/net/wireless/mediatek/mt76/eeprom.c
index a1529920d..0496493 100644
--- a/drivers/net/wireless/mediatek/mt76/eeprom.c
+++ b/drivers/net/wireless/mediatek/mt76/eeprom.c
@@ -94,7 +94,7 @@ 
 		return;
 
 	mac = of_get_mac_address(np);
-	if (mac)
+	if (!IS_ERR(mac))
 		memcpy(dev->macaddr, mac, ETH_ALEN);
 #endif
 
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
index 357c094..19a794a 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
@@ -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)) {