Linux kernel staging patches
 help / color / mirror / Atom feed
From: Martin Kaiser <martin@kaiser.cx>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	Phillip Potter <phil@philpotter.co.uk>,
	Michael Straube <straube.linux@gmail.com>,
	Pavel Skripkin <paskripkin@gmail.com>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH 04/14] staging: r8188eu: merge EFUSE_ShadowMapUpdate with its caller
Date: Sat,  9 Jul 2022 19:09:50 +0200	[thread overview]
Message-ID: <20220709171000.180481-5-martin@kaiser.cx> (raw)
In-Reply-To: <20220709171000.180481-1-martin@kaiser.cx>

Merge the EFUSE_ShadowMapUpdate function into ReadAdapterInfo8188EU, which
is the only caller.

Merging the two functions makes it clearer that eeprom->efuse_eeprom_data
is in fact a temporary buffer that stores info read from efuses.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/core/rtw_efuse.c    | 30 ---------------------
 drivers/staging/r8188eu/hal/usb_halinit.c   | 11 ++++++--
 drivers/staging/r8188eu/include/rtw_efuse.h |  2 --
 3 files changed, 9 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_efuse.c b/drivers/staging/r8188eu/core/rtw_efuse.c
index 8005ed8d3a20..df9534dd25cb 100644
--- a/drivers/staging/r8188eu/core/rtw_efuse.c
+++ b/drivers/staging/r8188eu/core/rtw_efuse.c
@@ -72,33 +72,3 @@ ReadEFuseByte(
 
 	/* FIXME: return an error to caller */
 }
-
-/*-----------------------------------------------------------------------------
- * Function:	EFUSE_ShadowMapUpdate
- *
- * Overview:	Transfer current EFUSE content to shadow init and modify map.
- *
- * Input:       NONE
- *
- * Output:      NONE
- *
- * Return:      NONE
- *
- * Revised History:
- * When			Who		Remark
- * 11/13/2008	MHC		Create Version 0.
- *
- *---------------------------------------------------------------------------*/
-void EFUSE_ShadowMapUpdate(struct adapter *pAdapter)
-{
-	struct eeprom_priv *pEEPROM = &pAdapter->eeprompriv;
-
-	if (pEEPROM->bautoload_fail_flag) {
-		memset(pEEPROM->efuse_eeprom_data, 0xFF, EFUSE_MAP_LEN_88E);
-		return;
-	}
-
-	rtl8188e_EfusePowerSwitch(pAdapter, true);
-	rtl8188e_ReadEFuse(pAdapter, 0, EFUSE_MAP_LEN_88E, pEEPROM->efuse_eeprom_data);
-	rtl8188e_EfusePowerSwitch(pAdapter, false);
-}
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 2bfd9751c685..18c2817bf1e3 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -939,8 +939,15 @@ void ReadAdapterInfo8188EU(struct adapter *Adapter)
 
 	eeprom->bautoload_fail_flag	= !(eeValue & EEPROM_EN);
 
-	if (!(eeValue & BOOT_FROM_EEPROM))
-		EFUSE_ShadowMapUpdate(Adapter);
+	if (!(eeValue & BOOT_FROM_EEPROM)) {
+		if (eeprom->bautoload_fail_flag) {
+			memset(eeprom->efuse_eeprom_data, 0xFF, EFUSE_MAP_LEN_88E);
+		} else {
+			rtl8188e_EfusePowerSwitch(Adapter, true);
+			rtl8188e_ReadEFuse(Adapter, 0, EFUSE_MAP_LEN_88E, eeprom->efuse_eeprom_data);
+			rtl8188e_EfusePowerSwitch(Adapter, false);
+		}
+	}
 
 	/* parse the eeprom/efuse content */
 	Hal_EfuseParseIDCode88E(Adapter, eeprom->efuse_eeprom_data);
diff --git a/drivers/staging/r8188eu/include/rtw_efuse.h b/drivers/staging/r8188eu/include/rtw_efuse.h
index 2daf69f554d5..3d688a0e6dfb 100644
--- a/drivers/staging/r8188eu/include/rtw_efuse.h
+++ b/drivers/staging/r8188eu/include/rtw_efuse.h
@@ -8,6 +8,4 @@
 
 void ReadEFuseByte(struct adapter *adapter, u16 _offset, u8 *pbuf);
 
-void EFUSE_ShadowMapUpdate(struct adapter *adapter);
-
 #endif
-- 
2.30.2


  parent reply	other threads:[~2022-07-09 17:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-09 17:09 [PATCH 00/14] clean up efuse reading Martin Kaiser
2022-07-09 17:09 ` [PATCH 01/14] staging: r8188eu: remove unused eeprom defines Martin Kaiser
2022-07-09 17:09 ` [PATCH 02/14] staging: r8188eu: remove EepromOrEfuse from struct eeprom_priv Martin Kaiser
2022-07-09 17:09 ` [PATCH 03/14] staging: r8188eu: remove eeprom function prototypes Martin Kaiser
2022-07-09 17:09 ` Martin Kaiser [this message]
2022-07-09 17:09 ` [PATCH 05/14] staging: r8188eu: use a local buffer for efuse data Martin Kaiser
2022-07-12 12:25   ` Dan Carpenter
2022-07-12 13:45     ` Larry Finger
2022-07-09 17:09 ` [PATCH 06/14] staging: r8188eu: always initialise efuse buffer with 0xff Martin Kaiser
2022-07-09 17:09 ` [PATCH 07/14] staging: r8188eu: use memcpy for fallback mac address Martin Kaiser
2022-07-12 16:28   ` Joe Perches
2022-07-09 17:09 ` [PATCH 08/14] staging: r8188eu: merge ReadEFuseByIC into rtl8188e_ReadEFuse Martin Kaiser
2022-07-09 17:09 ` [PATCH 09/14] staging: r8188eu: txpktbuf_bndy is always 0 Martin Kaiser
2022-07-09 17:09 ` [PATCH 10/14] staging: r8188eu: offset is always 0 in rtl8188e_ReadEFuse Martin Kaiser
2022-07-09 17:09 ` [PATCH 11/14] staging: r8188eu: offset is always 0 in iol_read_efuse Martin Kaiser
2022-07-09 17:09 ` [PATCH 12/14] staging: r8188eu: _offset is always 0 in efuse_phymap_to_logical Martin Kaiser
2022-07-09 17:09 ` [PATCH 13/14] staging: r8188eu: efuse_utilized is never read Martin Kaiser
2022-07-09 17:10 ` [PATCH 14/14] staging: r8188eu: the bcnhead parameter is always 0 Martin Kaiser

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=20220709171000.180481-5-martin@kaiser.cx \
    --to=martin@kaiser.cx \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=paskripkin@gmail.com \
    --cc=phil@philpotter.co.uk \
    --cc=straube.linux@gmail.com \
    /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