From: Michael Straube <straube.linux@gmail.com>
To: gregkh@linuxfoundation.org
Cc: hdegoede@redhat.com, Larry.Finger@lwfinger.net,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Michael Straube <straube.linux@gmail.com>
Subject: [PATCH 11/14] staging: rtl8723bs: remove bPseudoTest from hal_EfuseSwitchToBank
Date: Sat, 23 Aug 2025 14:43:18 +0200 [thread overview]
Message-ID: <20250823124321.485910-12-straube.linux@gmail.com> (raw)
In-Reply-To: <20250823124321.485910-1-straube.linux@gmail.com>
The function hal_EfuseSwitchToBank is always called with bPseudoTest set to
false. Remove the pPseudoTest parameter and reomve resulting dead code to
reduce code complexity.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
.../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 62 +++++++------------
1 file changed, 24 insertions(+), 38 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
index 0679f77e3498..014d94894de9 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
@@ -445,47 +445,33 @@ void rtl8723b_InitializeFirmwareVars(struct adapter *padapter)
/* Efuse related code */
/* */
static u8 hal_EfuseSwitchToBank(
- struct adapter *padapter, u8 bank, bool bPseudoTest
+ struct adapter *padapter, u8 bank
)
{
u8 bRet = false;
u32 value32 = 0;
-#ifdef HAL_EFUSE_MEMORY
- struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
- struct efuse_hal *pEfuseHal = &pHalData->EfuseHal;
-#endif
-
- if (bPseudoTest) {
-#ifdef HAL_EFUSE_MEMORY
- pEfuseHal->fakeEfuseBank = bank;
-#else
- fakeEfuseBank = bank;
-#endif
- bRet = true;
- } else {
- value32 = rtw_read32(padapter, EFUSE_TEST);
- bRet = true;
- switch (bank) {
- case 0:
- value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_WIFI_SEL_0);
- break;
- case 1:
- value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_BT_SEL_0);
- break;
- case 2:
- value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_BT_SEL_1);
- break;
- case 3:
- value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_BT_SEL_2);
- break;
- default:
- value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_WIFI_SEL_0);
- bRet = false;
- break;
- }
- rtw_write32(padapter, EFUSE_TEST, value32);
+ value32 = rtw_read32(padapter, EFUSE_TEST);
+ bRet = true;
+ switch (bank) {
+ case 0:
+ value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_WIFI_SEL_0);
+ break;
+ case 1:
+ value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_BT_SEL_0);
+ break;
+ case 2:
+ value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_BT_SEL_1);
+ break;
+ case 3:
+ value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_BT_SEL_2);
+ break;
+ default:
+ value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_WIFI_SEL_0);
+ bRet = false;
+ break;
}
+ rtw_write32(padapter, EFUSE_TEST, value32);
return bRet;
}
@@ -692,7 +678,7 @@ static void hal_ReadEFuse_WiFi(
memset(efuseTbl, 0xFF, EFUSE_MAX_MAP_LEN);
/* switch bank back to bank 0 for later BT and wifi use. */
- hal_EfuseSwitchToBank(padapter, 0, false);
+ hal_EfuseSwitchToBank(padapter, 0);
while (AVAILABLE_EFUSE_ADDR(eFuse_Addr)) {
efuse_OneByteRead(padapter, eFuse_Addr++, &efuseHeader, false);
@@ -782,7 +768,7 @@ static void hal_ReadEFuse_BT(
Hal_GetEfuseDefinition(padapter, EFUSE_BT, TYPE_AVAILABLE_EFUSE_BYTES_BANK, &total);
for (bank = 1; bank < 3; bank++) { /* 8723b Max bake 0~2 */
- if (hal_EfuseSwitchToBank(padapter, bank, false) == false)
+ if (hal_EfuseSwitchToBank(padapter, bank) == false)
goto exit;
eFuse_Addr = 0;
@@ -833,7 +819,7 @@ static void hal_ReadEFuse_BT(
}
/* switch bank back to bank 0 for later BT and wifi use. */
- hal_EfuseSwitchToBank(padapter, 0, false);
+ hal_EfuseSwitchToBank(padapter, 0);
/* Copy from Efuse map to output pointer memory!!! */
for (i = 0; i < _size_byte; i++)
--
2.51.0
next prev parent reply other threads:[~2025-08-23 12:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-23 12:43 [PATCH 00/14] staging: rtl8723bs: clean up efuse related code Michael Straube
2025-08-23 12:43 ` [PATCH 01/14] staging: rtl8723bs: remove bPseudoTest from EFUSE_ShadowMapUpdate Michael Straube
2025-08-23 12:43 ` [PATCH 02/14] staging: rtl8723bs: make Efuse_ReadAllMap static Michael Straube
2025-08-23 12:43 ` [PATCH 03/14] staging: rtl8723bs: remove bPseudoTest from Efuse_ReadAllMap Michael Straube
2025-08-23 12:43 ` [PATCH 04/14] staging: rtl8723bs: remove wrapper efuse_ReadEFuse Michael Straube
2025-08-23 12:43 ` [PATCH 05/14] staging: rtl8723bs: remove bPseudoTest from Hal_ReadEFuse Michael Straube
2025-08-23 12:43 ` [PATCH 06/14] staging: rtl8723bs: remove bPseudoTest from hal_ReadEFuse_WiFi Michael Straube
2025-08-23 12:43 ` [PATCH 07/14] staging: rtl8723bs: remove bPseudoTest from hal_ReadEFuse_BT Michael Straube
2025-08-23 12:43 ` [PATCH 08/14] staging: rtl8723bs: remove wrapper EFUSE_GetEfuseDefinition Michael Straube
2025-08-23 12:43 ` [PATCH 09/14] staging: rtl8723bs: remove bPseudoTest from Hal_GetEfuseDefinition Michael Straube
2025-08-23 12:43 ` [PATCH 10/14] staging: rtl8723bs: remove Hal_EfuseGetCurrentSize Michael Straube
2025-08-23 12:43 ` Michael Straube [this message]
2025-08-23 12:43 ` [PATCH 12/14] staging: rtl8723bs: clean up variable initializations Michael Straube
2025-08-23 12:43 ` [PATCH 13/14] staging: rtl8723bs: remove bPseudoTest from efuse_OneByteRead Michael Straube
2025-08-23 12:43 ` [PATCH 14/14] staging: rtl8723bs: remove efuse_OneByteWrite Michael Straube
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250823124321.485910-12-straube.linux@gmail.com \
--to=straube.linux@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®