diff options
author | Eliad Peller <eliadx.peller@intel.com> | 2015-07-30 16:53:27 +0300 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-08-16 10:14:31 +0300 |
commit | 80de4321a65c680dd7ce0138d88dc96e0d2a18fb (patch) | |
tree | 4c558dfd7bae315d8ea55db84c6bece96dfddbbe /drivers/net/wireless/iwlwifi | |
parent | b084a35663c3f1f7de1c45c4ae3006864c940fe7 (diff) | |
download | linux-80de4321a65c680dd7ce0138d88dc96e0d2a18fb.tar.xz |
iwlwifi: make sure d3_suspend/resume ops exist
We added calls to d3_suspend/resume trans ops during the
suspend/resume flow.
However, the wrapper code didn't verify the trans ops were
actually defined, resulting in panic when they were not
(such as in the case of sdio trans)
Fixes: 6dfb36c89dc2 ("iwlwifi: call d3_suspend/resume in d0i3 case as well")
Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index 9d8b5cb06343..c829c505e141 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h @@ -810,7 +810,8 @@ static inline void iwl_trans_stop_device(struct iwl_trans *trans) static inline void iwl_trans_d3_suspend(struct iwl_trans *trans, bool test) { might_sleep(); - trans->ops->d3_suspend(trans, test); + if (trans->ops->d3_suspend) + trans->ops->d3_suspend(trans, test); } static inline int iwl_trans_d3_resume(struct iwl_trans *trans, @@ -818,6 +819,9 @@ static inline int iwl_trans_d3_resume(struct iwl_trans *trans, bool test) { might_sleep(); + if (!trans->ops->d3_resume) + return 0; + return trans->ops->d3_resume(trans, status, test); } |