Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80de4321 authored by Eliad Peller's avatar Eliad Peller Committed by Emmanuel Grumbach
Browse files

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: 6dfb36c8 ("iwlwifi: call d3_suspend/resume in d0i3 case as well")

Signed-off-by: default avatarEliad Peller <eliadx.peller@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent b084a356
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -810,6 +810,7 @@ static inline void iwl_trans_stop_device(struct iwl_trans *trans)
static inline void iwl_trans_d3_suspend(struct iwl_trans *trans, bool test)
static inline void iwl_trans_d3_suspend(struct iwl_trans *trans, bool test)
{
{
	might_sleep();
	might_sleep();
	if (trans->ops->d3_suspend)
		trans->ops->d3_suspend(trans, test);
		trans->ops->d3_suspend(trans, test);
}
}


@@ -818,6 +819,9 @@ static inline int iwl_trans_d3_resume(struct iwl_trans *trans,
				      bool test)
				      bool test)
{
{
	might_sleep();
	might_sleep();
	if (!trans->ops->d3_resume)
		return 0;

	return trans->ops->d3_resume(trans, status, test);
	return trans->ops->d3_resume(trans, status, test);
}
}