From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DFBBC636C8 for ; Sun, 18 Jul 2021 17:37:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 69D01611AE for ; Sun, 18 Jul 2021 17:37:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231945AbhGRRkv (ORCPT ); Sun, 18 Jul 2021 13:40:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230215AbhGRRkc (ORCPT ); Sun, 18 Jul 2021 13:40:32 -0400 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49950C061762; Sun, 18 Jul 2021 10:37:34 -0700 (PDT) Received: from dslb-178-004-206-019.178.004.pools.vodafone-ip.de ([178.4.206.19] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1m5AjJ-0006oR-TM; Sun, 18 Jul 2021 19:37:29 +0200 From: Martin Kaiser To: Larry Finger , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 05/10] staging: rtl8188eu: remove struct eeprom_priv's EepromOrEfuse Date: Sun, 18 Jul 2021 19:36:05 +0200 Message-Id: <20210718173610.894-5-martin@kaiser.cx> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210718173610.894-1-martin@kaiser.cx> References: <20210718173610.894-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This setting is used only in one place. There's no need to store it in a global struct. While at it, merge the two-line Hal_InitPGData88E function and its only caller. Signed-off-by: Martin Kaiser --- drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c | 6 ------ drivers/staging/rtl8188eu/hal/usb_halinit.c | 5 +++-- drivers/staging/rtl8188eu/include/hal_intf.h | 2 -- drivers/staging/rtl8188eu/include/rtl8188e_hal.h | 3 --- 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c index d1086699f952..62cbe052397f 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c @@ -228,12 +228,6 @@ s32 InitLLTTable(struct adapter *padapter, u8 txpktbuf_bndy) return status; } -void Hal_InitPGData88E(struct adapter *padapter) -{ - if (!is_boot_from_eeprom(padapter)) - EFUSE_ShadowMapUpdate(padapter); -} - void Hal_EfuseParseIDCode88E(struct adapter *padapter, u8 *hwinfo) { struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter); diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c index 26c445a77e35..e0961919fcf8 100644 --- a/drivers/staging/rtl8188eu/hal/usb_halinit.c +++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c @@ -995,10 +995,11 @@ void rtw_hal_read_chip_info(struct adapter *Adapter) struct eeprom_priv *eeprom = GET_EEPROM_EFUSE_PRIV(Adapter); u8 eeValue = usb_read8(Adapter, REG_9346CR); - eeprom->EepromOrEfuse = (eeValue & BOOT_FROM_EEPROM) ? true : false; eeprom->bautoload_fail_flag = (eeValue & EEPROM_EN) ? false : true; - Hal_InitPGData88E(Adapter); + if (eeValue & BOOT_FROM_EEPROM) + EFUSE_ShadowMapUpdate(Adapter); + readAdapterInfo_8188EU(Adapter); } diff --git a/drivers/staging/rtl8188eu/include/hal_intf.h b/drivers/staging/rtl8188eu/include/hal_intf.h index c74249fc200f..4d4e0a259050 100644 --- a/drivers/staging/rtl8188eu/include/hal_intf.h +++ b/drivers/staging/rtl8188eu/include/hal_intf.h @@ -131,8 +131,6 @@ enum hardware_type { #define GET_EEPROM_EFUSE_PRIV(adapter) (&adapter->eeprompriv) -#define is_boot_from_eeprom(adapter) (adapter->eeprompriv.EepromOrEfuse) - void UpdateHalRAMask8188EUsb(struct adapter *adapt, u32 mac_id, u8 rssi_level); u32 rtl8188eu_hal_deinit(struct adapter *Adapter); u32 rtl8188eu_hal_init(struct adapter *Adapter); diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h index 2c16d3f33e1c..f585cbe21a6f 100644 --- a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h +++ b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h @@ -196,8 +196,6 @@ struct hal_data_8188e { u8 bTXPowerDataReadFromEEPORM; u8 EEPROMThermalMeter; - bool EepromOrEfuse; - u8 Index24G_CCK_Base[MAX_RF_PATH][CHANNEL_MAX_NUMBER]; u8 Index24G_BW40_Base[MAX_RF_PATH][CHANNEL_MAX_NUMBER]; /* If only one tx, only BW20 and OFDM are used. */ @@ -298,7 +296,6 @@ void rtl8188e_InitializeFirmwareVars(struct adapter *padapter); s32 InitLLTTable(struct adapter *padapter, u8 txpktbuf_bndy); /* EFuse */ -void Hal_InitPGData88E(struct adapter *padapter); void Hal_EfuseParseIDCode88E(struct adapter *padapter, u8 *hwinfo); void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail); -- 2.20.1