wifi: ath9k: return by of_get_mac_address
PATCH v2 1/1 wifi: ath9k: return by of_get_mac_address
When using nvmem, ath9k could potentially be loaded before nvmem, which loads after mtd. This is an issue if DT contains an nvmem mac address.
If nvmem is not ready in time for ath9k, -EPROBE_DEFER is returned. Pass it to _probe so that ath9k can properly grab a potentially present MAC address.
---
v2: modified commit message
drivers/net/wireless/ath/ath9k/init.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/wireless/ath/ath9k/init.c +1 -3
@@ -647,9 +647,7 @@ static int ath9k_of_init(struct ath_softc *sc) ah->ah_flags |=AH_NO_EEP_SWAP ; } -of_get_mac_address (np, common->macaddr); - -return 0 ; +return of_get_mac_address (np, common->macaddr); } static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
Signature · 1 line
2.46.2
Toke Høiland-Jørgensen
maintainerQuoted 18 lines · Rosen Penev
When using nvmem, ath9k could potentially be loaded before nvmem, which loads after mtd. This is an issue if DT contains an nvmem mac address.
If nvmem is not ready in time for ath9k, -EPROBE_DEFER is returned. Pass it to
_probeso that ath9k can properly grab a potentially present MAC address.Signed-off-by Rosen Penev <[email protected]>---
v2: modified commit messagedrivers/net/wireless/ath/ath9k/init.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/net/wireless/ath/ath9k/init.c +0
-0
drivers/net/wireless/ath/ath9k/init.c static int ath9k_of_init(struct ath_softc *sc) · line 650
Quoted 7 lines
drivers/net/wireless/ath/ath9k/init.c +1
-3@@ -647,9 +647,7 @@ static int ath9k_of_init(struct ath_softc *sc) ah->ah_flags |=AH_NO_EEP_SWAP ; } -of_get_mac_address (np, common->macaddr); - -return 0 ; +return of_get_mac_address (np, common->macaddr);
Hmm, so AFAICT, of_get_mac_address() can fail with lots of other error codes than EPROBE_DEFER, no? And with this change, if it does, we now abort the ath9k device init, where before we just ignored any errors.
So, to be conservative, maybe it's better to do something like:
ret = of_get_mac_address(np, common->macaddr);
if (ret == -EPROBE_DEFER)
return ret;
return 0;
WDYT?
-Toke
Quoted 35 lines · Toke Høiland-Jørgensen
Quoted 18 lines · Rosen Penev
When using nvmem, ath9k could potentially be loaded before nvmem, which loads after mtd. This is an issue if DT contains an nvmem mac address.
If nvmem is not ready in time for ath9k, -EPROBE_DEFER is returned. Pass it to
_probeso that ath9k can properly grab a potentially present MAC address.Signed-off-by Rosen Penev <[email protected]>---
v2: modified commit messagedrivers/net/wireless/ath/ath9k/init.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/net/wireless/ath/ath9k/init.c +0
-0drivers/net/wireless/ath/ath9k/init.c static int ath9k_of_init(struct ath_softc *sc) · line 650
Quoted 7 lines
drivers/net/wireless/ath/ath9k/init.c +1
-3@@ -647,9 +647,7 @@ static int ath9k_of_init(struct ath_softc *sc) ah->ah_flags |=AH_NO_EEP_SWAP ; } -of_get_mac_address (np, common->macaddr); - -return 0 ; +return of_get_mac_address (np, common->macaddr);Hmm, so AFAICT,
of_get_mac_address()can fail with lots of other error codes thanEPROBE_DEFER, no? And with this change, if it does, we now abort the ath9k device init, where before we just ignored any errors.So, to be conservative, maybe it's better to do something like:
Quoted 8 lines
ret =
of_get_mac_address(np, common->macaddr);
if (ret == -EPROBE_DEFER)
return ret;return 0;
WDYT?
I agree. Sent v3.
Quoted 2 lines
-Toke