From: Emmanuel Grumbach Date: Tue, 7 Feb 2012 12:27:31 +0000 (+0200) Subject: iwlwifi: drv object can release its own memory X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=07590f080d5f29e33158b22f7ad6079b85d87609;p=linux-beck.git iwlwifi: drv object can release its own memory Move that code to the iwl-drv.c Signed-off-by: Emmanuel Grumbach Signed-off-by: Wey-Yi Guy --- 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, return ret; } +void iwl_drv_stop(struct iwl_shared *shrd) +{ + iwl_remove(shrd->priv); + + kfree(shrd->nic); +} + 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 @@ int iwl_drv_start(struct iwl_shared *shrd, struct iwl_trans *trans, struct iwl_cfg *cfg); +/** + * iwl_drv_stop - stop the drv + * + * @shrd: the shrd area + * + * TODO: review the parameters given to this function + * + * Stop the driver. This should be called by bus specific system flows + * implementations. For example, the bus specific remove function should first + * call this function and then do the bus related operations only. + */ +void iwl_drv_stop(struct iwl_shared *shrd); + #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) struct iwl_bus *bus = pci_get_drvdata(pdev); struct iwl_shared *shrd = bus->shrd; - iwl_remove(shrd->priv); + iwl_drv_stop(shrd); iwl_trans_free(shrd->trans); pci_set_drvdata(pdev, NULL); - kfree(bus->shrd->nic); kfree(bus->shrd); kfree(bus); }