Commit 4f23c43c authored by YueHaibing's avatar YueHaibing Committed by David S. Miller

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: default avatarYueHaibing <yuehaibing@huawei.com>
Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0f5c6c30
...@@ -726,15 +726,6 @@ static struct mlxsw_driver *mlxsw_core_driver_get(const char *kind) ...@@ -726,15 +726,6 @@ static struct mlxsw_driver *mlxsw_core_driver_get(const char *kind)
return mlxsw_driver; return mlxsw_driver;
} }
static void mlxsw_core_driver_put(const char *kind)
{
struct mlxsw_driver *mlxsw_driver;
spin_lock(&mlxsw_core_driver_list_lock);
mlxsw_driver = __driver_find(kind);
spin_unlock(&mlxsw_core_driver_list_lock);
}
static int mlxsw_devlink_port_split(struct devlink *devlink, static int mlxsw_devlink_port_split(struct devlink *devlink,
unsigned int port_index, unsigned int port_index,
unsigned int count, unsigned int count,
...@@ -1082,7 +1073,6 @@ int mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, ...@@ -1082,7 +1073,6 @@ int mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,
if (!reload) if (!reload)
devlink_free(devlink); devlink_free(devlink);
err_devlink_alloc: err_devlink_alloc:
mlxsw_core_driver_put(device_kind);
return err; return err;
} }
EXPORT_SYMBOL(mlxsw_core_bus_device_register); EXPORT_SYMBOL(mlxsw_core_bus_device_register);
...@@ -1090,7 +1080,6 @@ EXPORT_SYMBOL(mlxsw_core_bus_device_register); ...@@ -1090,7 +1080,6 @@ EXPORT_SYMBOL(mlxsw_core_bus_device_register);
void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core, void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core,
bool reload) bool reload)
{ {
const char *device_kind = mlxsw_core->bus_info->device_kind;
struct devlink *devlink = priv_to_devlink(mlxsw_core); struct devlink *devlink = priv_to_devlink(mlxsw_core);
if (mlxsw_core->reload_fail) if (mlxsw_core->reload_fail)
...@@ -1111,7 +1100,6 @@ void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core, ...@@ -1111,7 +1100,6 @@ void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core,
return; return;
reload_fail: reload_fail:
devlink_free(devlink); devlink_free(devlink);
mlxsw_core_driver_put(device_kind);
} }
EXPORT_SYMBOL(mlxsw_core_bus_device_unregister); EXPORT_SYMBOL(mlxsw_core_bus_device_unregister);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment