aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2018-08-09 22:37:30 -0400
committerDavid S. Miller <davem@davemloft.net>2018-08-10 17:40:57 -0400
commit4f23c43c414d81b377a07b936e7edfe7167660b5 (patch)
treee5d6d1fe054a4e37a2f623269ad61468cb59f0eb
parent0f5c6c30a0f8c629b92ecdaef61b315c43fde10a (diff)
mlxsw: core: remove unnecessary function mlxsw_core_driver_put
The function mlxsw_core_driver_put only traverse mlxsw_core_driver_list to find the matched mlxsw_driver,but never used it. So it can be removed safely. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/core.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c
index b5d5e57f1583..81533d7f395c 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core.c
@@ -726,15 +726,6 @@ static struct mlxsw_driver *mlxsw_core_driver_get(const char *kind)
726 return mlxsw_driver; 726 return mlxsw_driver;
727} 727}
728 728
729static void mlxsw_core_driver_put(const char *kind)
730{
731 struct mlxsw_driver *mlxsw_driver;
732
733 spin_lock(&mlxsw_core_driver_list_lock);
734 mlxsw_driver = __driver_find(kind);
735 spin_unlock(&mlxsw_core_driver_list_lock);
736}
737
738static int mlxsw_devlink_port_split(struct devlink *devlink, 729static int mlxsw_devlink_port_split(struct devlink *devlink,
739 unsigned int port_index, 730 unsigned int port_index,
740 unsigned int count, 731 unsigned int count,
@@ -1082,7 +1073,6 @@ err_bus_init:
1082 if (!reload) 1073 if (!reload)
1083 devlink_free(devlink); 1074 devlink_free(devlink);
1084err_devlink_alloc: 1075err_devlink_alloc:
1085 mlxsw_core_driver_put(device_kind);
1086 return err; 1076 return err;
1087} 1077}
1088EXPORT_SYMBOL(mlxsw_core_bus_device_register); 1078EXPORT_SYMBOL(mlxsw_core_bus_device_register);
@@ -1090,7 +1080,6 @@ EXPORT_SYMBOL(mlxsw_core_bus_device_register);
1090void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core, 1080void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core,
1091 bool reload) 1081 bool reload)
1092{ 1082{
1093 const char *device_kind = mlxsw_core->bus_info->device_kind;
1094 struct devlink *devlink = priv_to_devlink(mlxsw_core); 1083 struct devlink *devlink = priv_to_devlink(mlxsw_core);
1095 1084
1096 if (mlxsw_core->reload_fail) 1085 if (mlxsw_core->reload_fail)
@@ -1111,7 +1100,6 @@ void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core,
1111 return; 1100 return;
1112reload_fail: 1101reload_fail:
1113 devlink_free(devlink); 1102 devlink_free(devlink);
1114 mlxsw_core_driver_put(device_kind);
1115} 1103}
1116EXPORT_SYMBOL(mlxsw_core_bus_device_unregister); 1104EXPORT_SYMBOL(mlxsw_core_bus_device_unregister);
1117 1105