提交 ede615d2 编写于 作者: V Vasanthakumar Thiagarajan 提交者: Kalle Valo

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: NVasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
上级 83685091
...@@ -1546,7 +1546,7 @@ static const char *ath6kl_init_get_hif_name(enum ath6kl_hif_type type) ...@@ -1546,7 +1546,7 @@ static const char *ath6kl_init_get_hif_name(enum ath6kl_hif_type type)
return NULL; return NULL;
} }
int ath6kl_init_hw_start(struct ath6kl *ar) static int __ath6kl_init_hw_start(struct ath6kl *ar)
{ {
long timeleft; long timeleft;
int ret, i; int ret, i;
...@@ -1642,8 +1642,6 @@ int ath6kl_init_hw_start(struct ath6kl *ar) ...@@ -1642,8 +1642,6 @@ int ath6kl_init_hw_start(struct ath6kl *ar)
goto err_htc_stop; goto err_htc_stop;
} }
ar->state = ATH6KL_STATE_ON;
return 0; return 0;
err_htc_stop: err_htc_stop:
...@@ -1656,7 +1654,18 @@ int ath6kl_init_hw_start(struct ath6kl *ar) ...@@ -1656,7 +1654,18 @@ int ath6kl_init_hw_start(struct ath6kl *ar)
return ret; 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; int ret;
...@@ -1672,8 +1681,17 @@ int ath6kl_init_hw_stop(struct ath6kl *ar) ...@@ -1672,8 +1681,17 @@ int ath6kl_init_hw_stop(struct ath6kl *ar)
if (ret) if (ret)
ath6kl_warn("failed to power off hif: %d\n", 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; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册