提交 07590f08 编写于 作者: E Emmanuel Grumbach 提交者: Wey-Yi Guy

iwlwifi: drv object can release its own memory

Move that code to the iwl-drv.c
Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: NWey-Yi Guy <wey-yi.w.guy@intel.com>
上级 5c58edc6
......@@ -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);
}
......@@ -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__ */
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册