summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-drv.c
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2012-03-26 08:51:09 -0700
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2012-04-18 07:20:06 -0700
commit9130bab137844d9ad3db6ab524de299cd2b9e39d (patch)
tree4a2b641fe5cb716540d049f11b35cd1d06d5e993 /drivers/net/wireless/iwlwifi/iwl-drv.c
parentb5abcf0219263f4e961dca71cbe26e06c5b0ee68 (diff)
iwlwifi: kill shrd->drv, driver points to transport
The driver layer now holds a pointer to the transport, and shrd->drv is not needed any more, so kill it. 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/wireless/iwlwifi/iwl-drv.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-drv.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c
index 17485e71542..8e296213938 100644
--- a/drivers/net/wireless/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/iwlwifi/iwl-drv.c
@@ -88,6 +88,7 @@ struct iwl_drv {
struct iwl_shared *shrd;
struct iwl_op_mode *op_mode;
+ struct iwl_trans *trans;
int fw_index; /* firmware we're trying to load */
char firmware_name[25]; /* name of firmware file to load */
@@ -858,7 +859,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
release_firmware(ucode_raw);
complete(&drv->request_firmware_complete);
- drv->op_mode = iwl_dvm_ops.start(drv->shrd->trans, &drv->fw);
+ drv->op_mode = iwl_dvm_ops.start(drv->trans, &drv->fw);
if (!drv->op_mode)
goto out_unbind;
@@ -881,8 +882,9 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
device_release_driver(trans(drv)->dev);
}
-int iwl_drv_start(struct iwl_shared *shrd,
- struct iwl_trans *trans, const struct iwl_cfg *cfg)
+struct iwl_drv *iwl_drv_start(struct iwl_shared *shrd,
+ struct iwl_trans *trans,
+ const struct iwl_cfg *cfg)
{
struct iwl_drv *drv;
int ret;
@@ -892,10 +894,11 @@ int iwl_drv_start(struct iwl_shared *shrd,
drv = kzalloc(sizeof(*drv), GFP_KERNEL);
if (!drv) {
dev_printk(KERN_ERR, trans->dev, "Couldn't allocate iwl_drv");
- return -ENOMEM;
+ return NULL;
}
+ /* For printing only - temporary until we change the logger */
drv->shrd = shrd;
- shrd->drv = drv;
+ drv->trans = trans;
init_completion(&drv->request_firmware_complete);
@@ -904,16 +907,14 @@ int iwl_drv_start(struct iwl_shared *shrd,
if (ret) {
dev_printk(KERN_ERR, trans->dev, "Couldn't request the fw");
kfree(drv);
- shrd->drv = NULL;
+ drv = NULL;
}
- return ret;
+ return drv;
}
-void iwl_drv_stop(struct iwl_shared *shrd)
+void iwl_drv_stop(struct iwl_drv *drv)
{
- struct iwl_drv *drv = shrd->drv;
-
wait_for_completion(&drv->request_firmware_complete);
/* op_mode can be NULL if its start failed */
@@ -923,5 +924,4 @@ void iwl_drv_stop(struct iwl_shared *shrd)
iwl_dealloc_ucode(drv);
kfree(drv);
- shrd->drv = NULL;
}