From 7b78bdc5f89b1bf59df0d7b0360d49bc1d3dff94 Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Sun, 30 Nov 2014 16:05:12 -0500 Subject: [PATCH] staging: rtl8723au: Fold _BlockWrite() into _PageWrite() Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- .../staging/rtl8723au/hal/rtl8723a_hal_init.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c index 01f1b79c165e..267a80b50630 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c @@ -47,29 +47,19 @@ static void _FWDownloadEnable(struct rtw_adapter *padapter, bool enable) } } -static int _BlockWrite(struct rtw_adapter *padapter, void *buffer, u32 buffSize) -{ - int ret; - - if (buffSize > MAX_PAGE_SIZE) - return _FAIL; - - ret = rtl8723au_writeN(padapter, FW_8723A_START_ADDRESS, - buffSize, buffer); - - return ret; -} - static int _PageWrite(struct rtw_adapter *padapter, u32 page, void *buffer, u32 size) { u8 value8; u8 u8Page = (u8) (page & 0x07); + if (size > MAX_PAGE_SIZE) + return _FAIL; + value8 = (rtl8723au_read8(padapter, REG_MCUFWDL + 2) & 0xF8) | u8Page; rtl8723au_write8(padapter, REG_MCUFWDL + 2, value8); - return _BlockWrite(padapter, buffer, size); + return rtl8723au_writeN(padapter, FW_8723A_START_ADDRESS, size, buffer); } static int _WriteFW(struct rtw_adapter *padapter, void *buffer, u32 size)