diff mbox series

[V2,01/11] qtnfmac_pcie: do not store FW name in driver state structure

Message ID 20180924221514.4273-2-igor.mitsyanko.os@quantenna.com (mailing list archive)
State Accepted
Commit 4059afc6bd17dc11b15ee219d25e9901890732f7
Delegated to: Kalle Valo
Headers show
Series qtnfmac_pcie: extract device-independent PCIe driver code | expand

Commit Message

Igor Mitsyanko Sept. 24, 2018, 10:15 p.m. UTC
Firmware name is only needed at probe stage, no point in keeping it in
driver state structure.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
---
 drivers/net/wireless/quantenna/qtnfmac/bus.h        | 1 -
 drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c | 8 ++++----
 2 files changed, 4 insertions(+), 5 deletions(-)

Comments

Kalle Valo Oct. 1, 2018, 3:41 p.m. UTC | #1
Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> wrote:

> Firmware name is only needed at probe stage, no point in keeping it in
> driver state structure.
> 
> Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>

11 patches applied to wireless-drivers-next.git, thanks.

4059afc6bd17 qtnfmac_pcie: do not store FW name in driver state structure
2ef0ecd71700 qtnfmac_pcie: move Pearl pcie sources to pcie-specific directory
91dcecece019 qtnfmac_pcie: rename private Pearl PCIe state structure
d0b95bfa1178 qtnfmac_pcie: indicate pearl-specific structures by their names
21077d09b4a6 qtnfmac_pcie: pearl: rename spinlock tx0_lock to tx_lock
c9ff6c9157c2 qtnfmac_pcie: separate platform-independent PCIe structure
789763b683eb qtnfmac_pcie: rename platform-specific functions
5163309e9a4d qtnfmac: add missing header includes to bus.h
addc7540708f qtnfmac_pcie: extract platform-independent PCIe code
86ca238cf1e9 qtnfmac: wait for FW load work to finish at PCIe remove
033a759921d1 qtnfmac_pcie: check for correct CHIP ID at pcie probe
diff mbox series

Patch

diff --git a/drivers/net/wireless/quantenna/qtnfmac/bus.h b/drivers/net/wireless/quantenna/qtnfmac/bus.h
index 323e47c..2beca5b 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/bus.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/bus.h
@@ -57,7 +57,6 @@  struct qtnf_bus {
 	struct qtnf_wmac *mac[QTNF_MAX_MAC];
 	struct qtnf_qlink_transport trans;
 	struct qtnf_hw_info hw_info;
-	char fwname[32];
 	struct napi_struct mux_napi;
 	struct net_device mux_dev;
 	struct completion firmware_init_complete;
diff --git a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c
index 3120d49..97cc7f2 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c
@@ -1177,13 +1177,14 @@  static void qtnf_fw_work_handler(struct work_struct *work)
 	const struct firmware *fw;
 	int ret;
 	u32 state = QTN_RC_FW_LOADRDY | QTN_RC_FW_QLINK;
+	const char *fwname = QTN_PCI_PEARL_FW_NAME;
 
 	if (flashboot) {
 		state |= QTN_RC_FW_FLASHBOOT;
 	} else {
-		ret = request_firmware(&fw, bus->fwname, &pdev->dev);
+		ret = request_firmware(&fw, fwname, &pdev->dev);
 		if (ret < 0) {
-			pr_err("failed to get firmware %s\n", bus->fwname);
+			pr_err("failed to get firmware %s\n", fwname);
 			goto fw_load_fail;
 		}
 	}
@@ -1205,7 +1206,7 @@  static void qtnf_fw_work_handler(struct work_struct *work)
 	if (flashboot) {
 		pr_info("booting firmware from flash\n");
 	} else {
-		pr_info("starting firmware upload: %s\n", bus->fwname);
+		pr_info("starting firmware upload: %s\n", fwname);
 
 		ret = qtnf_ep_fw_load(priv, fw->data, fw->size);
 		release_firmware(fw);
@@ -1290,7 +1291,6 @@  static int qtnf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	bus->fw_state = QTNF_FW_STATE_RESET;
 	pcie_priv->pdev = pdev;
 
-	strcpy(bus->fwname, QTN_PCI_PEARL_FW_NAME);
 	init_completion(&bus->firmware_init_complete);
 	mutex_init(&bus->bus_lock);
 	spin_lock_init(&pcie_priv->tx0_lock);