staging: r8188eu: use efuse map length define directly
authorMartin Kaiser <martin@kaiser.cx>
Sat, 13 Nov 2021 18:55:11 +0000 (19:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Nov 2021 09:32:35 +0000 (10:32 +0100)
The length of the efuse data section is constant. We can use the
corresponding define directly, there's no need to get the length
from rtl8188e_EFUSE_GetEfuseDefinition.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211113185518.23941-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_efuse.c

index 2999313dfe695f2ea9acaa845da5a71f8dbfc874..1a999d41483b3d8049335c2232354e95eb6a50e2 100644 (file)
@@ -6,6 +6,7 @@
 #include "../include/osdep_service.h"
 #include "../include/drv_types.h"
 #include "../include/rtw_efuse.h"
+#include "../include/rtl8188e_hal.h"
 
 /*------------------------Define local variable------------------------------*/
 u8 fakeEfuseBank;
@@ -234,17 +235,13 @@ void efuse_WordEnableDataRead(u8 word_en, u8 *sourdata, u8 *targetdata)
 void EFUSE_ShadowMapUpdate(struct adapter *pAdapter)
 {
        struct eeprom_priv *pEEPROM = &pAdapter->eeprompriv;
-       u16 mapLen = 0;
-
-       rtl8188e_EFUSE_GetEfuseDefinition(pAdapter, TYPE_EFUSE_MAP_LEN, (void *)&mapLen);
 
        if (pEEPROM->bautoload_fail_flag) {
-               memset(pEEPROM->efuse_eeprom_data, 0xFF, mapLen);
+               memset(pEEPROM->efuse_eeprom_data, 0xFF, EFUSE_MAP_LEN_88E);
                return;
        }
 
        rtl8188e_EfusePowerSwitch(pAdapter, true);
-       rtl8188e_EFUSE_GetEfuseDefinition(pAdapter, TYPE_EFUSE_MAP_LEN, (void *)&mapLen);
-       rtl8188e_ReadEFuse(pAdapter, 0, mapLen, pEEPROM->efuse_eeprom_data);
+       rtl8188e_ReadEFuse(pAdapter, 0, EFUSE_MAP_LEN_88E, pEEPROM->efuse_eeprom_data);
        rtl8188e_EfusePowerSwitch(pAdapter, false);
 }