Skip to contentSkip to conversation

wifi: ath9k: use non devm for nvmem_cell_get

PATCH Applied Rosen Penev 3 participants 3 messages Feb 23 – Apr 30 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: ath9k: use non devm for nvmem_cell_get

There's absolutely no need to extend the lifetime of cell to post removal of the driver. It's only used in this function.

---
 drivers/net/wireless/ath/ath9k/init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/init.c +2 -1
index 28dc6c0e27aa..38fb1e763c6e 100644
@@ -588,7 +588,7 @@ static int ath9k_nvmem_request_eeprom(struct ath_softc *sc)
 	size_t len;
 	int err;
 
-	cell = devm_nvmem_cell_get(sc->dev, "calibration");
+	cell = nvmem_cell_get(sc->dev, "calibration");
 	if (IS_ERR(cell)) {
 		err = PTR_ERR(cell);
 
@@ -605,6 +605,7 @@ static int ath9k_nvmem_request_eeprom(struct ath_softc *sc)
 	}
 
 	buf = nvmem_cell_read(cell, &len);
+	nvmem_cell_put(cell);
 	if (IS_ERR(buf))
 		return PTR_ERR(buf);
 

--
2.53.0

Applied
#2 lore raw
In reply to Rosen Penev
Quoted 4 lines · Rosen Penev

There's absolutely no need to extend the lifetime of cell to post removal of the driver. It's only used in this function.

Applied, thanks!

[1/1] wifi: ath9k: use non devm for nvmem_cell_get

      commit: 22e8b91d18972f5e1de13af7f55555e550ad1818

Best regards,

Signature · 1 line
Jeff Johnson <[email protected]>