2024-02-27 12:22:02

by Bitterblue Smith

[permalink] [raw]
Subject: [PATCH] wifi: rtlwifi: Remove rtl_intf_ops.read_efuse_byte

PCI drivers and USB drivers can both use the same function,
read_efuse_byte(), and they can call it directly.

rtl8192de was the only user.

Tested only with the upcoming rtl8192du driver.

Signed-off-by: Bitterblue Smith <[email protected]>
---
drivers/net/wireless/realtek/rtlwifi/pci.c | 1 -
drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c | 6 ++----
drivers/net/wireless/realtek/rtlwifi/wifi.h | 1 -
3 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c
index d059cfe5a2a9..11709b6c83f1 100644
--- a/drivers/net/wireless/realtek/rtlwifi/pci.c
+++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
@@ -2374,7 +2374,6 @@ EXPORT_SYMBOL(rtl_pci_resume);
#endif /* CONFIG_PM_SLEEP */

const struct rtl_intf_ops rtl_pci_ops = {
- .read_efuse_byte = read_efuse_byte,
.adapter_start = rtl_pci_start,
.adapter_stop = rtl_pci_stop,
.check_buddy_priv = rtl_pci_check_buddy_priv,
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
index 743ac6871bf4..4ba42f6be3f2 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
@@ -1669,10 +1669,8 @@ static void _rtl92de_efuse_update_chip_version(struct ieee80211_hw *hw)
u8 cutvalue[2];
u16 chipvalue;

- rtlpriv->intf_ops->read_efuse_byte(hw, EEPROME_CHIP_VERSION_H,
- &cutvalue[1]);
- rtlpriv->intf_ops->read_efuse_byte(hw, EEPROME_CHIP_VERSION_L,
- &cutvalue[0]);
+ read_efuse_byte(hw, EEPROME_CHIP_VERSION_H, &cutvalue[1]);
+ read_efuse_byte(hw, EEPROME_CHIP_VERSION_L, &cutvalue[0]);
chipvalue = (cutvalue[1] << 8) | cutvalue[0];
switch (chipvalue) {
case 0xAA55:
diff --git a/drivers/net/wireless/realtek/rtlwifi/wifi.h b/drivers/net/wireless/realtek/rtlwifi/wifi.h
index 01df00a43cdb..85187390b7de 100644
--- a/drivers/net/wireless/realtek/rtlwifi/wifi.h
+++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h
@@ -2292,7 +2292,6 @@ struct rtl_hal_ops {

struct rtl_intf_ops {
/*com */
- void (*read_efuse_byte)(struct ieee80211_hw *hw, u16 _offset, u8 *pbuf);
int (*adapter_start)(struct ieee80211_hw *hw);
void (*adapter_stop)(struct ieee80211_hw *hw);
bool (*check_buddy_priv)(struct ieee80211_hw *hw,
--
2.43.2


2024-02-29 01:24:03

by Ping-Ke Shih

[permalink] [raw]
Subject: RE: [PATCH] wifi: rtlwifi: Remove rtl_intf_ops.read_efuse_byte



> -----Original Message-----
> From: Bitterblue Smith <[email protected]>
> Sent: Tuesday, February 27, 2024 8:16 PM
> To: [email protected]
> Cc: Ping-Ke Shih <[email protected]>
> Subject: [PATCH] wifi: rtlwifi: Remove rtl_intf_ops.read_efuse_byte
>
> PCI drivers and USB drivers can both use the same function,
> read_efuse_byte(), and they can call it directly.
>
> rtl8192de was the only user.
>
> Tested only with the upcoming rtl8192du driver.
>
> Signed-off-by: Bitterblue Smith <[email protected]>

Acked-by: Ping-Ke Shih <[email protected]>


2024-03-05 18:54:24

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] wifi: rtlwifi: Remove rtl_intf_ops.read_efuse_byte

Bitterblue Smith <[email protected]> wrote:

> PCI drivers and USB drivers can both use the same function,
> read_efuse_byte(), and they can call it directly.
>
> rtl8192de was the only user.
>
> Tested only with the upcoming rtl8192du driver.
>
> Signed-off-by: Bitterblue Smith <[email protected]>
> Acked-by: Ping-Ke Shih <[email protected]>

Patch applied to wireless-next.git, thanks.

7979061313c8 wifi: rtlwifi: Remove rtl_intf_ops.read_efuse_byte

--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches