iwlwifi: print warning on request_module failure
authorJohannes Berg <johannes.berg@intel.com>
Thu, 4 Apr 2013 08:35:23 +0000 (10:35 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 8 Apr 2013 11:30:45 +0000 (13:30 +0200)
If request_module() failed then we didn't have the correct
opmode module that the driver needs to function, so print
a warning in this case to make it more obvious what could
be wrong. This still won't catch the case where the module
simply doesn't exist because it wasn't compiled though.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/iwlwifi/iwl-drv.c

index b98873c70255d3171567ddb2863d745cb9dbf6a0..39aad9893e0b1d6df218655959b77e292721babe 100644 (file)
@@ -998,8 +998,13 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
         * else from proceeding if the module fails to load
         * or hangs loading.
         */
-       if (load_module)
-               request_module("%s", op->name);
+       if (load_module) {
+               err = request_module("%s", op->name);
+               if (err)
+                       IWL_ERR(drv,
+                               "failed to load module %s (error %d), is dynamic loading enabled?\n",
+                               op->name, err);
+       }
        return;
 
  try_again: