Thread (11 messages) 11 messages, 1 author, 2011-09-06
STALE5399d
Revisions (4)
  1. resend [diff vs current]
  2. v1 current
  3. v1 [diff vs current]
  4. v1 [diff vs current]

[PATCH 02/10] iwlagn: merge iwl_pci_down and iwl_pci_remove

From: Wey-Yi Guy <hidden>
Date: 2011-09-06 17:15:06
Subsystem: networking drivers (wireless), the rest · Maintainers: Johannes Berg, Linus Torvalds

From: Emmanuel Grumbach <redacted>

The latter was the only place that called the first. The two
functions were split when the iwl_pci_probe called iwl_pci_down
upon failure in the probe. Since iwl_pci_probe undoes its work by
itself, there is no need to split between iwl_pci_down, and
iwl_pci_remove.

Thanks to Pavel Roskin for pointing that out.

Signed-off-by: Emmanuel Grumbach <redacted>
Signed-off-by: Wey-Yi Guy <redacted>
---
 drivers/net/wireless/iwlwifi/iwl-pci.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c b/drivers/net/wireless/iwlwifi/iwl-pci.c
index e41f53e..78a3f8d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-pci.c
+++ b/drivers/net/wireless/iwlwifi/iwl-pci.c
@@ -483,9 +483,13 @@ out_no_pci:
 	return err;
 }
 
-static void iwl_pci_down(struct iwl_bus *bus)
+static void __devexit iwl_pci_remove(struct pci_dev *pdev)
 {
-	struct iwl_pci_bus *pci_bus = (struct iwl_pci_bus *) bus->bus_specific;
+	struct iwl_shared *shrd = pci_get_drvdata(pdev);
+	struct iwl_bus *bus = shrd->bus;
+	struct iwl_pci_bus *pci_bus = IWL_BUS_GET_PCI_BUS(bus);
+
+	iwl_remove(shrd->priv);
 
 	pci_disable_msi(pci_bus->pci_dev);
 	pci_iounmap(pci_bus->pci_dev, pci_bus->hw_base);
@@ -496,16 +500,6 @@ static void iwl_pci_down(struct iwl_bus *bus)
 	kfree(bus);
 }
 
-static void __devexit iwl_pci_remove(struct pci_dev *pdev)
-{
-	struct iwl_shared *shrd = pci_get_drvdata(pdev);
-	struct iwl_bus *bus = shrd->bus;
-
-	iwl_remove(shrd->priv);
-
-	iwl_pci_down(bus);
-}
-
 #ifdef CONFIG_PM_SLEEP
 
 static int iwl_pci_suspend(struct device *device)
-- 
1.7.0.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help