From 082bfc6efdc9b84d4906b01cdbd0461ed78dfb1c Mon Sep 17 00:00:00 2001
From: Vignesh Raghavendra <vigneshr@ti.com>
Date: Wed, 17 Nov 2021 20:27:52 +0530
Subject: [PATCH] net: ti: icssg_qos: Remove icssg_qos_cleanup()

icssg_qos_cleanup() does not do anything more than icssg_qos_link_down()
Since icssg_qos_link_down() is always called during emac_ndo_stop()
calling icssg_qos_cleanup() from same path is redundant. So remove the
redundant code altogether.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
---
 drivers/net/ethernet/ti/icssg_prueth.c |  2 --
 drivers/net/ethernet/ti/icssg_qos.c    | 18 +-----------------
 drivers/net/ethernet/ti/icssg_qos.h    |  3 ---
 3 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/drivers/net/ethernet/ti/icssg_prueth.c b/drivers/net/ethernet/ti/icssg_prueth.c
index a4ac6f0d244a..a7754341eeda 100644
--- a/drivers/net/ethernet/ti/icssg_prueth.c
+++ b/drivers/net/ethernet/ti/icssg_prueth.c
@@ -1869,8 +1869,6 @@ static int emac_ndo_stop(struct net_device *ndev)
 	int rx_flow = emac->is_sr1 ?
 			PRUETH_RX_FLOW_DATA_SR1 : PRUETH_RX_FLOW_DATA_SR2;
 
-	icssg_qos_cleanup(ndev);
-
 	/* inform the upper layers. */
 	netif_tx_stop_all_queues(ndev);
 
diff --git a/drivers/net/ethernet/ti/icssg_qos.c b/drivers/net/ethernet/ti/icssg_qos.c
index d9098eabe967..32e99186829d 100644
--- a/drivers/net/ethernet/ti/icssg_qos.c
+++ b/drivers/net/ethernet/ti/icssg_qos.c
@@ -23,12 +23,9 @@ void icssg_qos_init(struct net_device *ndev)
 
 	icssg_qos_tas_init(ndev);
 
-	if (!iet->fpe_configured) {
-		iet->fpe_mask_configured = 0;
+	if (!iet->fpe_configured)
 		return;
-	}
 
-	iet->fpe_mask_configured = GENMASK(emac->tx_ch_num - 2, 0);
 	/* Init work queue for IET MAC verify process */
 	iet->emac = emac;
 	INIT_WORK(&iet->fpe_config_task, icssg_qos_enable_ietfpe);
@@ -41,19 +38,6 @@ void icssg_qos_init(struct net_device *ndev)
 	atomic_set(&iet->cancel_fpe_config, 0);
 }
 
-void icssg_qos_cleanup(struct net_device *ndev)
-{
-	struct prueth_emac *emac = netdev_priv(ndev);
-	struct prueth_qos_iet *iet = &emac->qos.iet;
-
-	if (!iet->fpe_enabled)
-		return;
-
-	iet->fpe_mask_configured = 0;
-	/* Send a command to firmware to stop FPE */
-	icssg_prueth_iet_fpe_disable(iet);
-}
-
 static void tas_update_fw_list_pointers(struct prueth_emac *emac)
 {
 	struct tas_config *tas = &emac->qos.tas.config;
diff --git a/drivers/net/ethernet/ti/icssg_qos.h b/drivers/net/ethernet/ti/icssg_qos.h
index f0555cf2c314..f29363bb1058 100644
--- a/drivers/net/ethernet/ti/icssg_qos.h
+++ b/drivers/net/ethernet/ti/icssg_qos.h
@@ -121,8 +121,6 @@ struct prueth_qos_iet {
 	 * in firmware
 	 */
 	bool mac_verify_configured;
-	/* configured queue mask */
-	u32 fpe_mask_configured;
 };
 
 struct prueth_qos {
@@ -131,7 +129,6 @@ struct prueth_qos {
 };
 
 void icssg_qos_init(struct net_device *ndev);
-void icssg_qos_cleanup(struct net_device *ndev);
 int icssg_qos_ndo_setup_tc(struct net_device *ndev, enum tc_setup_type type,
 			   void *type_data);
 void icssg_qos_link_up(struct net_device *ndev);
