[7/7] staging: rtl8192e: Remove entry .nic_type from struct rtl819x_ops

Message ID f1fd37a2d2b90bef8caac31a98f3eeff404b3095.1677010997.git.philipp.g.hortmann@gmail.com
State New
Headers
Series staging: rtl8192e: Remove entries from struct rtl819x_ops start with .tx_enable |

Commit Message

Philipp Hortmann Feb. 21, 2023, 8:53 p.m. UTC
  Remove unchanged entry .nic_type and replace it with constant NIC_8192E.
This increases readability of the code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 -
 drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 -
 drivers/staging/rtl8192e/rtl8192e/rtl_pci.c  | 6 +++---
 3 files changed, 3 insertions(+), 5 deletions(-)
  

Comments

Dan Carpenter Feb. 22, 2023, 1:40 p.m. UTC | #1
On Tue, Feb 21, 2023 at 09:53:43PM +0100, Philipp Hortmann wrote:
> Remove unchanged entry .nic_type and replace it with constant NIC_8192E.
> This increases readability of the code.
> 
> Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
> ---
>  drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 -
>  drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 -
>  drivers/staging/rtl8192e/rtl8192e/rtl_pci.c  | 6 +++---
>  3 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> index 2d2f9d4a0ff5..044cab649ff1 100644
> --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> @@ -26,7 +26,6 @@ int hwwep = 1;
>  static char *ifname = "wlan%d";
>  
>  static const struct rtl819x_ops rtl819xp_ops = {
> -	.nic_type			= NIC_8192E,
>  };

Delete.

>  
>  static struct pci_device_id rtl8192_pci_id_tbl[] = {
> diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
> index fa72f8891409..f75cc96052d9 100644
> --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
> +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
> @@ -204,7 +204,6 @@ struct rtl8192_tx_ring {
>  };
>  
>  struct rtl819x_ops {
> -	enum nic_t nic_type;
>  };

Delete this empty struct too.

Otherwise these patches are really nice.  Thanks!

regards,
dan carpenter
  

Patch

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 2d2f9d4a0ff5..044cab649ff1 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -26,7 +26,6 @@  int hwwep = 1;
 static char *ifname = "wlan%d";
 
 static const struct rtl819x_ops rtl819xp_ops = {
-	.nic_type			= NIC_8192E,
 };
 
 static struct pci_device_id rtl8192_pci_id_tbl[] = {
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index fa72f8891409..f75cc96052d9 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -204,7 +204,6 @@  struct rtl8192_tx_ring {
 };
 
 struct rtl819x_ops {
-	enum nic_t nic_type;
 };
 
 struct r8192_priv {
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c b/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c
index 81e1bb856c60..0bc3e013001e 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c
@@ -39,7 +39,7 @@  bool rtl92e_check_adapter(struct pci_dev *pdev, struct net_device *dev)
 	revision_id = pdev->revision;
 	pci_read_config_word(pdev, 0x3C, &irq_line);
 
-	priv->card_8192 = priv->ops->nic_type;
+	priv->card_8192 = NIC_8192E;
 
 	if (device_id == 0x8192) {
 		switch (revision_id) {
@@ -64,10 +64,10 @@  bool rtl92e_check_adapter(struct pci_dev *pdev, struct net_device *dev)
 		}
 	}
 
-	if (priv->ops->nic_type != priv->card_8192) {
+	if (priv->card_8192 != NIC_8192E) {
 		dev_info(&pdev->dev,
 			 "Detect info(%x) and hardware info(%x) not match!\n",
-			 priv->ops->nic_type, priv->card_8192);
+			 NIC_8192E, priv->card_8192);
 		dev_info(&pdev->dev,
 			 "Please select proper driver before install!!!!\n");
 		return false;