OSDN Git Service

devlink: pass devlink_port pointer to ops->port_del() instead of index
authorJiri Pirko <jiri@nvidia.com>
Tue, 23 May 2023 12:38:01 +0000 (14:38 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 May 2023 09:34:26 +0000 (10:34 +0100)
commit9277649c66fe7cb0e2f8adb09621556bcfb052c7
tree60b58207fb829af1dc46d492864ffea60464aab5
parent1bb1b57898504da4e10d48b901556278e161c7fd
devlink: pass devlink_port pointer to ops->port_del() instead of index

Historically there was a reason why port_dev() along with for example
port_split() did get port_index instead of the devlink_port pointer.
With the locking changes that were done which ensured devlink instance
mutex is hold for every command, the port ops could get devlink_port
pointer directly. Change the forgotten port_dev() op to be as others
and pass devlink_port pointer instead of port_index.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c
drivers/net/ethernet/mellanox/mlx5/core/sf/sf.h
include/net/devlink.h
net/devlink/leftover.c