ATH10K Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath10k: Use sdio_release_host() call only once in two functions
@ 2024-09-20 13:45 Markus Elfring
  0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2024-09-20 13:45 UTC (permalink / raw)
  To: ath10k, linux-wireless, Erik Stromdahl, Jeff Johnson, Kalle Valo
  Cc: LKML, Julia Lawall

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 20 Sep 2024 15:36:19 +0200

A sdio_release_host() call was immediately used after a return code check
in two function implementations.
Thus use such a function call only once instead directly before the checks.

This issue was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/net/wireless/ath/ath10k/sdio.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c
index 08a6f36a6be9..432dee87d73b 100644
--- a/drivers/net/wireless/ath/ath10k/sdio.c
+++ b/drivers/net/wireless/ath/ath10k/sdio.c
@@ -1589,14 +1589,12 @@ static int ath10k_sdio_hif_power_up(struct ath10k *ar,
 	sdio_claim_host(func);

 	ret = sdio_enable_func(func);
+	sdio_release_host(func);
 	if (ret) {
 		ath10k_warn(ar, "unable to enable sdio function: %d)\n", ret);
-		sdio_release_host(func);
 		return ret;
 	}

-	sdio_release_host(func);
-
 	/* Wait for hardware to initialise. It should take a lot less than
 	 * 20 ms but let's be conservative here.
 	 */
@@ -1884,14 +1882,12 @@ static int ath10k_sdio_hif_start(struct ath10k *ar)

 	/* Register the isr */
 	ret =  sdio_claim_irq(ar_sdio->func, ath10k_sdio_irq_handler);
+	sdio_release_host(ar_sdio->func);
 	if (ret) {
 		ath10k_warn(ar, "failed to claim sdio interrupt: %d\n", ret);
-		sdio_release_host(ar_sdio->func);
 		return ret;
 	}

-	sdio_release_host(ar_sdio->func);
-
 	ret = ath10k_sdio_enable_intrs(ar);
 	if (ret)
 		ath10k_warn(ar, "failed to enable sdio interrupts: %d\n", ret);
--
2.46.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-09-20 13:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-20 13:45 [PATCH] ath10k: Use sdio_release_host() call only once in two functions Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox