* [PATCH net-next] mlxsw: core: remove unnecessary function mlxsw_core_driver_put
@ 2018-08-10 2:37 YueHaibing
2018-08-10 15:26 ` Ido Schimmel
2018-08-10 21:42 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2018-08-10 2:37 UTC (permalink / raw)
To: davem, jiri, idosch; +Cc: linux-kernel, netdev, YueHaibing
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>
---
drivers/net/ethernet/mellanox/mlxsw/core.c | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c
index b5d5e57..81533d7 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)
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,
unsigned int port_index,
unsigned int count,
@@ -1082,7 +1073,6 @@ int mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,
if (!reload)
devlink_free(devlink);
err_devlink_alloc:
- mlxsw_core_driver_put(device_kind);
return err;
}
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,
bool reload)
{
- const char *device_kind = mlxsw_core->bus_info->device_kind;
struct devlink *devlink = priv_to_devlink(mlxsw_core);
if (mlxsw_core->reload_fail)
@@ -1111,7 +1100,6 @@ void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core,
return;
reload_fail:
devlink_free(devlink);
- mlxsw_core_driver_put(device_kind);
}
EXPORT_SYMBOL(mlxsw_core_bus_device_unregister);
--
2.7.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] mlxsw: core: remove unnecessary function mlxsw_core_driver_put
2018-08-10 2:37 [PATCH net-next] mlxsw: core: remove unnecessary function mlxsw_core_driver_put YueHaibing
@ 2018-08-10 15:26 ` Ido Schimmel
2018-08-10 21:42 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Ido Schimmel @ 2018-08-10 15:26 UTC (permalink / raw)
To: YueHaibing; +Cc: davem, jiri, linux-kernel, netdev
On Fri, Aug 10, 2018 at 10:37:30AM +0800, YueHaibing wrote:
> 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>
FWIW, this function used to call module_put(), but it was removed in
commit 1d20d23c59c9 ("mlxsw: Move PCI id table definitions into driver
modules").
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] mlxsw: core: remove unnecessary function mlxsw_core_driver_put
2018-08-10 2:37 [PATCH net-next] mlxsw: core: remove unnecessary function mlxsw_core_driver_put YueHaibing
2018-08-10 15:26 ` Ido Schimmel
@ 2018-08-10 21:42 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-08-10 21:42 UTC (permalink / raw)
To: yuehaibing; +Cc: jiri, idosch, linux-kernel, netdev
From: YueHaibing <yuehaibing@huawei.com>
Date: Fri, 10 Aug 2018 10:37:30 +0800
> 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>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-08-10 21:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-10 2:37 [PATCH net-next] mlxsw: core: remove unnecessary function mlxsw_core_driver_put YueHaibing
2018-08-10 15:26 ` Ido Schimmel
2018-08-10 21:42 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).