Skip to content

Commit 236faa3

Browse files
mistraubegregkh
authored andcommitted
staging: rtl8723bs: remove bWrite from Hal_EfusePowerSwitch
The function Hal_EfusePowerSwitch is always called with bWrite set to false. Remove the pWrite parameter and reomve resulting dead code to reduce code complexity. Signed-off-by: Michael Straube <straube.linux@gmail.com> Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Trendbook Next 14 Link: https://lore.kernel.org/r/20250824095830.79233-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 009798f commit 236faa3

3 files changed

Lines changed: 6 additions & 25 deletions

File tree

drivers/staging/rtl8723bs/core/rtw_efuse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,13 @@ static void Efuse_ReadAllMap(struct adapter *padapter, u8 efuseType, u8 *Efuse)
164164
{
165165
u16 mapLen = 0;
166166

167-
Hal_EfusePowerSwitch(padapter, false, true);
167+
Hal_EfusePowerSwitch(padapter, true);
168168

169169
Hal_GetEfuseDefinition(padapter, efuseType, TYPE_EFUSE_MAP_LEN, (void *)&mapLen);
170170

171171
Hal_ReadEFuse(padapter, efuseType, 0, mapLen, Efuse);
172172

173-
Hal_EfusePowerSwitch(padapter, false, false);
173+
Hal_EfusePowerSwitch(padapter, false);
174174
}
175175

176176
/*-----------------------------------------------------------------------------

drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,6 @@ void Hal_GetEfuseDefinition(
568568
}
569569
}
570570

571-
#define VOLTAGE_V25 0x03
572-
573571
/* */
574572
/* The following is for compile ok */
575573
/* That should be merged with the original in the future */
@@ -578,7 +576,7 @@ void Hal_GetEfuseDefinition(
578576
#define REG_EFUSE_ACCESS_8723 0x00CF /* Efuse access protection for RTL8723 */
579577

580578
void Hal_EfusePowerSwitch(
581-
struct adapter *padapter, u8 bWrite, u8 PwrState
579+
struct adapter *padapter, u8 PwrState
582580
)
583581
{
584582
u8 tempval;
@@ -626,25 +624,8 @@ void Hal_EfusePowerSwitch(
626624
tmpV16 |= (LOADER_CLK_EN | ANA8M);
627625
rtw_write16(padapter, REG_SYS_CLKR, tmpV16);
628626
}
629-
630-
if (bWrite) {
631-
/* Enable LDO 2.5V before read/write action */
632-
tempval = rtw_read8(padapter, EFUSE_TEST+3);
633-
tempval &= 0x0F;
634-
tempval |= (VOLTAGE_V25 << 4);
635-
rtw_write8(padapter, EFUSE_TEST+3, (tempval | 0x80));
636-
637-
/* rtw_write8(padapter, REG_EFUSE_ACCESS, EFUSE_ACCESS_ON); */
638-
}
639627
} else {
640628
rtw_write8(padapter, REG_EFUSE_ACCESS, EFUSE_ACCESS_OFF);
641-
642-
if (bWrite) {
643-
/* Disable LDO 2.5V after read/write action */
644-
tempval = rtw_read8(padapter, EFUSE_TEST+3);
645-
rtw_write8(padapter, EFUSE_TEST+3, (tempval & 0x7F));
646-
}
647-
648629
}
649630
}
650631

@@ -1474,9 +1455,9 @@ void Hal_EfuseParsePackageType_8723B(
14741455
u8 package;
14751456
u8 efuseContent;
14761457

1477-
Hal_EfusePowerSwitch(padapter, false, true);
1458+
Hal_EfusePowerSwitch(padapter, true);
14781459
efuse_OneByteRead(padapter, 0x1FB, &efuseContent);
1479-
Hal_EfusePowerSwitch(padapter, false, false);
1460+
Hal_EfusePowerSwitch(padapter, false);
14801461

14811462
package = efuseContent & 0x7;
14821463
switch (package) {

drivers/staging/rtl8723bs/include/hal_intf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ u8 GetHalDefVar8723BSDIO(struct adapter *Adapter, enum hal_def_variable eVariabl
265265
u8 SetHalDefVar8723BSDIO(struct adapter *Adapter, enum hal_def_variable eVariable, void *pValue);
266266
void UpdateHalRAMask8723B(struct adapter *padapter, u32 mac_id, u8 rssi_level);
267267
void rtl8723b_SetBeaconRelatedRegisters(struct adapter *padapter);
268-
void Hal_EfusePowerSwitch(struct adapter *padapter, u8 bWrite, u8 PwrState);
268+
void Hal_EfusePowerSwitch(struct adapter *padapter, u8 PwrState);
269269
void Hal_ReadEFuse(struct adapter *padapter, u8 efuseType, u16 _offset,
270270
u16 _size_byte, u8 *pbuf);
271271
void Hal_GetEfuseDefinition(struct adapter *padapter, u8 efuseType, u8 type,

0 commit comments

Comments
 (0)