public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Rosen Penev <rosenp@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: Jeff Johnson <jjohnson@kernel.org>,
	ath10k@lists.infradead.org (open list:QUALCOMM ATHEROS ATH10K
	WIRELESS DRIVER), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH ath-next] wifi: ath10k: switch to of_get_mac_address
Date: Fri,  8 Aug 2025 20:15:17 -0700	[thread overview]
Message-ID: <20250809031517.5535-1-rosenp@gmail.com> (raw)

In 9d5804662ce1f9bdde0a14c3c40940acbbf09538 , device_get_mac_address was
introduced as a generic way to get MAC addresses from anywhere.
Unfortunately since then, the landscape has changed and the OF version
is required for NVMEM support. The second problem is that with NVMEM
it's possible that it loads after ath10k. For that reason, check for
deferred errors and exit out of probe in such a case.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/net/wireless/ath/ath10k/core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 6f78f1752cd6..76747eb0925b 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,9 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
 		ath10k_debug_print_board_info(ar);
 	}
 
-	device_get_mac_address(ar->dev, ar->mac_addr);
+	ret = of_get_mac_address(ar->dev->of_node, ar->mac_addr);
+	if (ret == -EPROBE_DEFER)
+		goto err_free_firmware_files;
 
 	ret = ath10k_core_init_firmware_features(ar);
 	if (ret) {
-- 
2.50.1


             reply	other threads:[~2025-08-09  3:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-09  3:15 Rosen Penev [this message]
2025-08-11 19:55 ` [PATCH ath-next] wifi: ath10k: switch to of_get_mac_address Jeff Johnson
2025-08-11 20:25   ` Rosen Penev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250809031517.5535-1-rosenp@gmail.com \
    --to=rosenp@gmail.com \
    --cc=ath10k@lists.infradead.org \
    --cc=jjohnson@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox