Skip to content

Commit 6c22a11

Browse files
ogerlitzSaeed Mahameed
authored andcommitted
net/mlx5: Remove the get protocol device interface entry
This isn't used anywhere across the mlx5 driver stack, remove it. Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Reviewed-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
1 parent a2c6162 commit 6c22a11

File tree

3 files changed

+0
-32
lines changed

3 files changed

+0
-32
lines changed

drivers/net/ethernet/mellanox/mlx5/core/dev.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -256,28 +256,6 @@ void mlx5_reload_interface(struct mlx5_core_dev *mdev, int protocol)
256256
mutex_unlock(&mlx5_intf_mutex);
257257
}
258258

259-
void *mlx5_get_protocol_dev(struct mlx5_core_dev *mdev, int protocol)
260-
{
261-
struct mlx5_priv *priv = &mdev->priv;
262-
struct mlx5_device_context *dev_ctx;
263-
unsigned long flags;
264-
void *result = NULL;
265-
266-
spin_lock_irqsave(&priv->ctx_lock, flags);
267-
268-
list_for_each_entry(dev_ctx, &mdev->priv.ctx_list, list)
269-
if ((dev_ctx->intf->protocol == protocol) &&
270-
dev_ctx->intf->get_dev) {
271-
result = dev_ctx->intf->get_dev(dev_ctx->context);
272-
break;
273-
}
274-
275-
spin_unlock_irqrestore(&priv->ctx_lock, flags);
276-
277-
return result;
278-
}
279-
EXPORT_SYMBOL(mlx5_get_protocol_dev);
280-
281259
/* Must be called with intf_mutex held */
282260
void mlx5_add_dev_by_protocol(struct mlx5_core_dev *dev, int protocol)
283261
{

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5160,20 +5160,12 @@ static void mlx5e_remove(struct mlx5_core_dev *mdev, void *vpriv)
51605160
kfree(ppriv);
51615161
}
51625162

5163-
static void *mlx5e_get_netdev(void *vpriv)
5164-
{
5165-
struct mlx5e_priv *priv = vpriv;
5166-
5167-
return priv->netdev;
5168-
}
5169-
51705163
static struct mlx5_interface mlx5e_interface = {
51715164
.add = mlx5e_add,
51725165
.remove = mlx5e_remove,
51735166
.attach = mlx5e_attach,
51745167
.detach = mlx5e_detach,
51755168
.protocol = MLX5_INTERFACE_PROTOCOL_ETH,
5176-
.get_dev = mlx5e_get_netdev,
51775169
};
51785170

51795171
void mlx5e_init(void)

include/linux/mlx5/driver.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,12 +1004,10 @@ struct mlx5_interface {
10041004
void (*remove)(struct mlx5_core_dev *dev, void *context);
10051005
int (*attach)(struct mlx5_core_dev *dev, void *context);
10061006
void (*detach)(struct mlx5_core_dev *dev, void *context);
1007-
void * (*get_dev)(void *context);
10081007
int protocol;
10091008
struct list_head list;
10101009
};
10111010

1012-
void *mlx5_get_protocol_dev(struct mlx5_core_dev *mdev, int protocol);
10131011
int mlx5_register_interface(struct mlx5_interface *intf);
10141012
void mlx5_unregister_interface(struct mlx5_interface *intf);
10151013
int mlx5_notifier_register(struct mlx5_core_dev *dev, struct notifier_block *nb);

0 commit comments

Comments
 (0)