提交 d9d6a5ae 编写于 作者: R Rajkumar Manoharan 提交者: Kalle Valo

ath10k: reduce indentation by moving powersave check within function

For devices that does not support PCI power save, force wake up
API is used. So move powersave check inside force wakeup to reduce
one level indentation.
Signed-off-by: NRajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
上级 aa538aca
...@@ -487,6 +487,9 @@ static int ath10k_pci_force_wake(struct ath10k *ar) ...@@ -487,6 +487,9 @@ static int ath10k_pci_force_wake(struct ath10k *ar)
unsigned long flags; unsigned long flags;
int ret = 0; int ret = 0;
if (ar_pci->pci_ps)
return ret;
spin_lock_irqsave(&ar_pci->ps_lock, flags); spin_lock_irqsave(&ar_pci->ps_lock, flags);
if (!ar_pci->ps_awake) { if (!ar_pci->ps_awake) {
...@@ -2480,13 +2483,11 @@ static int ath10k_pci_hif_resume(struct ath10k *ar) ...@@ -2480,13 +2483,11 @@ static int ath10k_pci_hif_resume(struct ath10k *ar)
u32 val; u32 val;
int ret = 0; int ret = 0;
if (ar_pci->pci_ps == 0) {
ret = ath10k_pci_force_wake(ar); ret = ath10k_pci_force_wake(ar);
if (ret) { if (ret) {
ath10k_err(ar, "failed to wake up target: %d\n", ret); ath10k_err(ar, "failed to wake up target: %d\n", ret);
return ret; return ret;
} }
}
/* Suspend/Resume resets the PCI configuration space, so we have to /* Suspend/Resume resets the PCI configuration space, so we have to
* re-disable the RETRY_TIMEOUT register (0x41) to keep PCI Tx retries * re-disable the RETRY_TIMEOUT register (0x41) to keep PCI Tx retries
...@@ -2592,14 +2593,11 @@ static irqreturn_t ath10k_pci_interrupt_handler(int irq, void *arg) ...@@ -2592,14 +2593,11 @@ static irqreturn_t ath10k_pci_interrupt_handler(int irq, void *arg)
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
int ret; int ret;
if (ar_pci->pci_ps == 0) {
ret = ath10k_pci_force_wake(ar); ret = ath10k_pci_force_wake(ar);
if (ret) { if (ret) {
ath10k_warn(ar, "failed to wake device up on irq: %d\n", ath10k_warn(ar, "failed to wake device up on irq: %d\n", ret);
ret);
return IRQ_NONE; return IRQ_NONE;
} }
}
if (ar_pci->num_msi_intrs == 0) { if (ar_pci->num_msi_intrs == 0) {
if (!ath10k_pci_irq_pending(ar)) if (!ath10k_pci_irq_pending(ar))
...@@ -3071,13 +3069,11 @@ static int ath10k_pci_probe(struct pci_dev *pdev, ...@@ -3071,13 +3069,11 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
goto err_sleep; goto err_sleep;
} }
if (ar_pci->pci_ps == 0) {
ret = ath10k_pci_force_wake(ar); ret = ath10k_pci_force_wake(ar);
if (ret) { if (ret) {
ath10k_warn(ar, "failed to wake up device : %d\n", ret); ath10k_warn(ar, "failed to wake up device : %d\n", ret);
goto err_free_pipes; goto err_free_pipes;
} }
}
ath10k_pci_ce_deinit(ar); ath10k_pci_ce_deinit(ar);
ath10k_pci_irq_disable(ar); ath10k_pci_irq_disable(ar);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册