Blob Blame History Raw
From 03928b4be345f0b0872a07929aa4844f2cef0e17 Mon Sep 17 00:00:00 2001
From: Alaa Hleihel <ahleihel@redhat.com>
Date: Tue, 19 May 2020 07:49:31 -0400
Subject: [PATCH 268/312] [netdrv] net/mlx5: Simplify mlx5_unload_one() and its
 callers

Message-id: <20200519074934.6303-61-ahleihel@redhat.com>
Patchwork-id: 310559
Patchwork-instance: patchwork
O-Subject: [RHEL8.3 BZ 1663246 60/63] net/mlx5: Simplify mlx5_unload_one() and its callers
Bugzilla: 1835595 1663246
RH-Acked-by: Marcelo Leitner <mleitner@redhat.com>
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
RH-Acked-by: John Linville <linville@redhat.com>
RH-Acked-by: Ivan Vecera <ivecera@redhat.com>
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
RH-Acked-by: Kamal Heib <kheib@redhat.com>

Bugzilla: http://bugzilla.redhat.com/1835595
Bugzilla: http://bugzilla.redhat.com/1663246
Upstream: v5.7-rc1

commit f999b706b7ab5dae45a3ee5c2b3bc2b47c11b0c5
Author: Parav Pandit <parav@mellanox.com>
Date:   Sun Mar 8 23:17:37 2020 -0500

    net/mlx5: Simplify mlx5_unload_one() and its callers

    mlx5_unload_one() always returns 0.
    Simplify callers of mlx5_unload_one() and remove the dead code.

    Reviewed-by: Moshe Shemesh <moshe@mellanox.com>
    Signed-off-by: Parav Pandit <parav@mellanox.com>
    Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>

[ Conflicts: mlx5_unload_one was static as
             "[netdrv] net/mlx5: Add devlink reload" is skipped.  ]

Signed-off-by: Alaa Hleihel <ahleihel@redhat.com>
Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 8df92ccf6393..f575f684ad78 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -1252,7 +1252,7 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, bool boot)
 	return err;
 }
 
-static int mlx5_unload_one(struct mlx5_core_dev *dev, bool cleanup)
+static void mlx5_unload_one(struct mlx5_core_dev *dev, bool cleanup)
 {
 	if (cleanup) {
 		mlx5_unregister_device(dev);
@@ -1281,7 +1281,6 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, bool cleanup)
 	mlx5_function_teardown(dev, cleanup);
 out:
 	mutex_unlock(&dev->intf_state_mutex);
-	return 0;
 }
 
 static int mlx5_mdev_init(struct mlx5_core_dev *dev, int profile_idx)
@@ -1402,12 +1401,7 @@ static void remove_one(struct pci_dev *pdev)
 	mlx5_crdump_disable(dev);
 	mlx5_devlink_unregister(devlink);
 
-	if (mlx5_unload_one(dev, true)) {
-		mlx5_core_err(dev, "mlx5_unload_one failed\n");
-		mlx5_health_flush(dev);
-		return;
-	}
-
+	mlx5_unload_one(dev, true);
 	mlx5_pci_close(dev);
 	mlx5_mdev_uninit(dev);
 	mlx5_devlink_free(devlink);
-- 
2.13.6