diff mbox series

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

Message ID 5437e685-8fb5-45f4-a78e-9aa961f5adf7@web.de (mailing list archive)
State Rejected
Delegated to: Jeff Johnson
Headers show
Series ath6kl: Adjustments for ath6kl_sdio_power_on() | expand

Commit Message

Markus Elfring Sept. 21, 2024, 12:02 p.m. UTC
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(-)

--
2.46.0
diff mbox series

Patch

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.