summaryrefslogtreecommitdiff
path: root/include/net/devlink.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@nvidia.com>2023-05-23 14:38:01 +0200
committerDavid S. Miller <davem@davemloft.net>2023-05-24 10:34:26 +0100
commit9277649c66fe7cb0e2f8adb09621556bcfb052c7 (patch)
tree60b58207fb829af1dc46d492864ffea60464aab5 /include/net/devlink.h
parent1bb1b57898504da4e10d48b901556278e161c7fd (diff)
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>
Diffstat (limited to 'include/net/devlink.h')
-rw-r--r--include/net/devlink.h4
1 files changed, 2 insertions, 2 deletions
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