From 9277649c66fe7cb0e2f8adb09621556bcfb052c7 Mon Sep 17 00:00:00 2001 From: Jiri Pirko Date: Tue, 23 May 2023 14:38:01 +0200 Subject: 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 Reviewed-by: Simon Horman Signed-off-by: David S. Miller --- include/net/devlink.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/net/devlink.h') diff --git a/include/net/devlink.h b/include/net/devlink.h index 24a48f3d4c35..1bd56c8d6f3c 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -1516,7 +1516,7 @@ struct devlink_ops { /** * port_del() - Delete a port function * @devlink: Devlink instance - * @port_index: port function index to delete + * @port: The devlink port * @extack: extack for reporting error messages * * Devlink core will call this device driver function upon user request @@ -1528,7 +1528,7 @@ struct devlink_ops { * * Return: 0 on success, negative value otherwise. */ - int (*port_del)(struct devlink *devlink, unsigned int port_index, + int (*port_del)(struct devlink *devlink, struct devlink_port *port, struct netlink_ext_ack *extack); /** * port_fn_state_get() - Get the state of a port function -- cgit