staging: r8188eu: Fix while-loop that iterates only once
[linux-2.6-microblaze.git] / drivers / staging / rtl8188eu / hal / rtl8188e_hal_init.c
index b06bdcf..1c63658 100644 (file)
@@ -168,25 +168,24 @@ void rtw_hal_notch_filter(struct adapter *adapter, bool enable)
 static s32 _LLTWrite(struct adapter *padapter, u32 address, u32 data)
 {
        s32     status = _SUCCESS;
-       s32     count = 0;
+       s32     count;
        u32     value = _LLT_INIT_ADDR(address) | _LLT_INIT_DATA(data) | _LLT_OP(_LLT_WRITE_ACCESS);
        u16     LLTReg = REG_LLT_INIT;
 
        usb_write32(padapter, LLTReg, value);
 
        /* polling */
-       do {
+       for (count = 0; ; count++) {
                value = usb_read32(padapter, LLTReg);
                if (_LLT_OP_VALUE(value) == _LLT_NO_ACTIVE)
                        break;
 
                if (count > POLLING_LLT_THRESHOLD) {
-                       RT_TRACE(_module_hal_init_c_, _drv_err_, ("Failed to polling write LLT done at address %d!\n", address));
                        status = _FAIL;
                        break;
                }
                udelay(5);
-       } while (count++);
+       }
 
        return status;
 }
@@ -231,19 +230,8 @@ s32 InitLLTTable(struct adapter *padapter, u8 txpktbuf_bndy)
 
 void Hal_InitPGData88E(struct adapter *padapter)
 {
-       struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter);
-
-       if (!pEEPROM->bautoload_fail_flag) { /*  autoload OK. */
-               if (!is_boot_from_eeprom(padapter)) {
-                       /*  Read EFUSE real map to shadow. */
-                       EFUSE_ShadowMapUpdate(padapter, EFUSE_WIFI);
-               }
-       } else {/* autoload fail */
-               RT_TRACE(_module_hci_hal_init_c_, _drv_notice_, ("AutoLoad Fail reported from CR9346!!\n"));
-               /* update to default value 0xFF */
-               if (!is_boot_from_eeprom(padapter))
-                       EFUSE_ShadowMapUpdate(padapter, EFUSE_WIFI);
-       }
+       if (!is_boot_from_eeprom(padapter))
+               EFUSE_ShadowMapUpdate(padapter);
 }
 
 void Hal_EfuseParseIDCode88E(struct adapter *padapter, u8 *hwinfo)
@@ -465,9 +453,6 @@ void Hal_EfuseParseEEPROMVer88E(struct adapter *padapter, u8 *hwinfo, bool AutoL
        } else {
                pHalData->EEPROMVersion = 1;
        }
-       RT_TRACE(_module_hci_hal_init_c_, _drv_info_,
-                ("Hal_EfuseParseEEPROMVer(), EEVer = %d\n",
-                pHalData->EEPROMVersion));
 }
 
 void rtl8188e_EfuseParseChnlPlan(struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail)