[PATCH 1/3] ath6kl: Use sdio_release_host(func) call only once in ath6kl_sdio_power_on()

Markus Elfring posted 3 patches 2 months, 1 week ago
[PATCH 1/3] ath6kl: Use sdio_release_host(func) call only once in ath6kl_sdio_power_on()
Posted by Markus Elfring 2 months, 1 week ago
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 21 Sep 2024 12:00:19 +0200

A sdio_release_host(func) call was immediately used after a return code
check for a sdio_enable_func() call in this function implementation.
Thus use such a function call only once instead directly before the check.

This issue was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/net/wireless/ath/ath6kl/sdio.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index 9ab091044706..5106c6909dc8 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -514,14 +514,12 @@ static int ath6kl_sdio_power_on(struct ath6kl *ar)
 	sdio_claim_host(func);

 	ret = sdio_enable_func(func);
+	sdio_release_host(func);
 	if (ret) {
 		ath6kl_err("Unable to enable sdio func: %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
 	 * 10 ms but let's be conservative here.
--
2.46.0