diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2012-02-07 07:27:31 -0500 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2012-02-27 16:25:38 -0500 |
commit | 07590f080d5f29e33158b22f7ad6079b85d87609 (patch) | |
tree | 84869bef3498fbe6b46788cc6d5035cb6ea2d5e5 /drivers/net | |
parent | 5c58edc63edd6cd8097e2bee90e2d341e33bcd60 (diff) |
iwlwifi: drv object can release its own memory
Move that code to the iwl-drv.c
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-drv.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-drv.h | 13 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-pci.c | 3 |
3 files changed, 21 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c index 49f7e70bc362..b3876dec52af 100644 --- a/drivers/net/wireless/iwlwifi/iwl-drv.c +++ b/drivers/net/wireless/iwlwifi/iwl-drv.c | |||
@@ -92,3 +92,10 @@ int iwl_drv_start(struct iwl_shared *shrd, | |||
92 | return ret; | 92 | return ret; |
93 | } | 93 | } |
94 | 94 | ||
95 | void iwl_drv_stop(struct iwl_shared *shrd) | ||
96 | { | ||
97 | iwl_remove(shrd->priv); | ||
98 | |||
99 | kfree(shrd->nic); | ||
100 | } | ||
101 | |||
diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.h b/drivers/net/wireless/iwlwifi/iwl-drv.h index c40545199224..90534a23ddc8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-drv.h +++ b/drivers/net/wireless/iwlwifi/iwl-drv.h | |||
@@ -107,4 +107,17 @@ | |||
107 | int iwl_drv_start(struct iwl_shared *shrd, | 107 | int iwl_drv_start(struct iwl_shared *shrd, |
108 | struct iwl_trans *trans, struct iwl_cfg *cfg); | 108 | struct iwl_trans *trans, struct iwl_cfg *cfg); |
109 | 109 | ||
110 | /** | ||
111 | * iwl_drv_stop - stop the drv | ||
112 | * | ||
113 | * @shrd: the shrd area | ||
114 | * | ||
115 | * TODO: review the parameters given to this function | ||
116 | * | ||
117 | * Stop the driver. This should be called by bus specific system flows | ||
118 | * implementations. For example, the bus specific remove function should first | ||
119 | * call this function and then do the bus related operations only. | ||
120 | */ | ||
121 | void iwl_drv_stop(struct iwl_shared *shrd); | ||
122 | |||
110 | #endif /* __iwl_drv_h__ */ | 123 | #endif /* __iwl_drv_h__ */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c b/drivers/net/wireless/iwlwifi/iwl-pci.c index e2695445dfac..b9cdd1ac1744 100644 --- a/drivers/net/wireless/iwlwifi/iwl-pci.c +++ b/drivers/net/wireless/iwlwifi/iwl-pci.c | |||
@@ -321,12 +321,11 @@ static void __devexit iwl_pci_remove(struct pci_dev *pdev) | |||
321 | struct iwl_bus *bus = pci_get_drvdata(pdev); | 321 | struct iwl_bus *bus = pci_get_drvdata(pdev); |
322 | struct iwl_shared *shrd = bus->shrd; | 322 | struct iwl_shared *shrd = bus->shrd; |
323 | 323 | ||
324 | iwl_remove(shrd->priv); | 324 | iwl_drv_stop(shrd); |
325 | iwl_trans_free(shrd->trans); | 325 | iwl_trans_free(shrd->trans); |
326 | 326 | ||
327 | pci_set_drvdata(pdev, NULL); | 327 | pci_set_drvdata(pdev, NULL); |
328 | 328 | ||
329 | kfree(bus->shrd->nic); | ||
330 | kfree(bus->shrd); | 329 | kfree(bus->shrd); |
331 | kfree(bus); | 330 | kfree(bus); |
332 | } | 331 | } |