device_get_mac_address is a generic way to get the MAC address which
lacks NVMEM support, which tends to be used on embedded platforms.

of_get_mac_address has NVMEM support and handles most of what
device_get_mac_address does. The only thing missing is ACPI which is not
used to store MAC addresses for ath10k chips.

Signed-off-by: Rosen Penev <[email protected]>
---
 v2: keep device_get_mac_address and use of_get_mac_address_nvmem
 v3: back to of_get_mac_address
 drivers/net/wireless/ath/ath10k/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c 
b/drivers/net/wireless/ath/ath10k/core.c
index 6f78f1752cd6..2bf7a141d8c7 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -11,6 +11,7 @@
 #include <linux/module.h>
 #include <linux/firmware.h>
 #include <linux/of.h>
+#include <linux/of_net.h>
 #include <linux/property.h>
 #include <linux/dmi.h>
 #include <linux/ctype.h>
@@ -3456,7 +3457,7 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
                ath10k_debug_print_board_info(ar);
        }
 
-       device_get_mac_address(ar->dev, ar->mac_addr);
+       of_get_mac_address(ar->dev->of_node, ar->mac_addr);
 
        ret = ath10k_core_init_firmware_features(ar);
        if (ret) {
-- 
2.50.1


Reply via email to