mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-23 16:09:19 +07:00
ath6kl: Refactor ath6kl_init_hw_start() and ath6kl_init_hw_stop()
So that these functions will be used to re-initialize the fw upon detecting fw error. This refactoring moves ar->state setting out of core stop/start functionality. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
This commit is contained in:
parent
83685091ac
commit
ede615d2f0
@ -1546,7 +1546,7 @@ static const char *ath6kl_init_get_hif_name(enum ath6kl_hif_type type)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int ath6kl_init_hw_start(struct ath6kl *ar)
|
||||
static int __ath6kl_init_hw_start(struct ath6kl *ar)
|
||||
{
|
||||
long timeleft;
|
||||
int ret, i;
|
||||
@ -1642,8 +1642,6 @@ int ath6kl_init_hw_start(struct ath6kl *ar)
|
||||
goto err_htc_stop;
|
||||
}
|
||||
|
||||
ar->state = ATH6KL_STATE_ON;
|
||||
|
||||
return 0;
|
||||
|
||||
err_htc_stop:
|
||||
@ -1656,7 +1654,18 @@ int ath6kl_init_hw_start(struct ath6kl *ar)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ath6kl_init_hw_stop(struct ath6kl *ar)
|
||||
int ath6kl_init_hw_start(struct ath6kl *ar)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = __ath6kl_init_hw_start(ar);
|
||||
if (err)
|
||||
return err;
|
||||
ar->state = ATH6KL_STATE_ON;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __ath6kl_init_hw_stop(struct ath6kl *ar)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@ -1672,8 +1681,17 @@ int ath6kl_init_hw_stop(struct ath6kl *ar)
|
||||
if (ret)
|
||||
ath6kl_warn("failed to power off hif: %d\n", ret);
|
||||
|
||||
ar->state = ATH6KL_STATE_OFF;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ath6kl_init_hw_stop(struct ath6kl *ar)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = __ath6kl_init_hw_stop(ar);
|
||||
if (err)
|
||||
return err;
|
||||
ar->state = ATH6KL_STATE_OFF;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user