iwlwifi: uninline iwl_trans_send_cmd
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 1 Dec 2015 11:45:37 +0000 (13:45 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Sun, 13 Dec 2015 06:52:53 +0000 (08:52 +0200)
This function got too big to be inlined. Uninline it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/intel/iwlwifi/iwl-trans.c
drivers/net/wireless/intel/iwlwifi/iwl-trans.h

index ccd317b6408fe1cc2a45cc79798eed9ee316dc71..c3fafbc6b6549de902a92f2201ab9468a515c46c 100644 (file)
@@ -61,6 +61,7 @@
  *
  *****************************************************************************/
 #include <linux/kernel.h>
+#include "iwl-drv.h"
 #include "iwl-trans.h"
 
 struct iwl_trans *iwl_trans_alloc(unsigned int priv_size,
@@ -112,3 +113,35 @@ void iwl_trans_free(struct iwl_trans *trans)
        kmem_cache_destroy(trans->dev_cmd_pool);
        kfree(trans);
 }
+
+int iwl_trans_send_cmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
+{
+       int ret;
+
+       if (unlikely(!(cmd->flags & CMD_SEND_IN_RFKILL) &&
+                    test_bit(STATUS_RFKILL, &trans->status)))
+               return -ERFKILL;
+
+       if (unlikely(test_bit(STATUS_FW_ERROR, &trans->status)))
+               return -EIO;
+
+       if (unlikely(trans->state != IWL_TRANS_FW_ALIVE)) {
+               IWL_ERR(trans, "%s bad state = %d\n", __func__, trans->state);
+               return -EIO;
+       }
+
+       if (WARN_ON((cmd->flags & CMD_WANT_ASYNC_CALLBACK) &&
+                   !(cmd->flags & CMD_ASYNC)))
+               return -EINVAL;
+
+       if (!(cmd->flags & CMD_ASYNC))
+               lock_map_acquire_read(&trans->sync_cmd_lockdep_map);
+
+       ret = trans->ops->send_cmd(trans, cmd);
+
+       if (!(cmd->flags & CMD_ASYNC))
+               lock_map_release(&trans->sync_cmd_lockdep_map);
+
+       return ret;
+}
+IWL_EXPORT_SYMBOL(iwl_trans_send_cmd);
index 77ae7fa3053ebeb5bb1d794e59dc74b784bd7001..b825d940cc586b4111c6a1cecb8e4f12e3c58799 100644 (file)
@@ -889,38 +889,6 @@ iwl_trans_dump_data(struct iwl_trans *trans,
        return trans->ops->dump_data(trans, trigger);
 }
 
-static inline int iwl_trans_send_cmd(struct iwl_trans *trans,
-                                    struct iwl_host_cmd *cmd)
-{
-       int ret;
-
-       if (unlikely(!(cmd->flags & CMD_SEND_IN_RFKILL) &&
-                    test_bit(STATUS_RFKILL, &trans->status)))
-               return -ERFKILL;
-
-       if (unlikely(test_bit(STATUS_FW_ERROR, &trans->status)))
-               return -EIO;
-
-       if (unlikely(trans->state != IWL_TRANS_FW_ALIVE)) {
-               IWL_ERR(trans, "%s bad state = %d\n", __func__, trans->state);
-               return -EIO;
-       }
-
-       if (WARN_ON((cmd->flags & CMD_WANT_ASYNC_CALLBACK) &&
-                   !(cmd->flags & CMD_ASYNC)))
-               return -EINVAL;
-
-       if (!(cmd->flags & CMD_ASYNC))
-               lock_map_acquire_read(&trans->sync_cmd_lockdep_map);
-
-       ret = trans->ops->send_cmd(trans, cmd);
-
-       if (!(cmd->flags & CMD_ASYNC))
-               lock_map_release(&trans->sync_cmd_lockdep_map);
-
-       return ret;
-}
-
 static inline struct iwl_device_cmd *
 iwl_trans_alloc_tx_cmd(struct iwl_trans *trans)
 {
@@ -933,6 +901,8 @@ iwl_trans_alloc_tx_cmd(struct iwl_trans *trans)
                        (dev_cmd_ptr + trans->dev_cmd_headroom);
 }
 
+int iwl_trans_send_cmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd);
+
 static inline void iwl_trans_free_tx_cmd(struct iwl_trans *trans,
                                         struct iwl_device_cmd *dev_cmd)
 {